Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users/jstruga/test pr #276

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,50 @@ jobs:
github-repo: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}

check_changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: copy-repo
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

- name: Get changed files
id: changed-files
run: |
cd copy-repo
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi

- name: List changed files
id: set-flag
run: |
cd copy-repo
for file in ${{ steps.changed-files.outputs.changed_files }}; do
echo "$file was changed"
if [[ $file == "CHANGELOG.md" ]]
then
echo "file-flag=true" >> $GITHUB_OUTPUT
break;
else
echo "file-flag=false" >> $GITHUB_OUTPUT
fi
done

- name: Check if CHANGELOG is Updated and Abort if not updated
if: steps.set-flag.outputs.file-flag != 'true'
run: |
echo "CHANGELOG not added. Please add the CHANGELOG in the CHANGELOG.md file"
exit 1

build:
runs-on: ubuntu-latest
needs: check-permission
steps:

- name: '[Prep 1] Cache node modules'
uses: actions/cache@v2
with:
Expand Down
Loading