Skip to content

Commit

Permalink
CI: skip pr in nrf fails CI
Browse files Browse the repository at this point in the history
prevent action from executing if to be skipped

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Apr 16, 2024
1 parent 6c74181 commit da0a166
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/on-pr_nrf_manifest_update_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,26 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- name: Read body of PR
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{github.repository}}/pulls/${{github.event.number}} --jq '.body' > pr_body.md
- name: Parse body
id: config
shell: bash {0}
run: |
cat pr_body.md
grep -oP "manifest-pr-skip" pr_body.md
if [ $? != 0 ]; then
echo "manifest-pr-skip=false" >> $GITHUB_OUTPUT;
else
echo "manifest-pr-skip=true" >> $GITHUB_OUTPUT;
fi;
- name: Create manifest PR
if: ! ${{ steps.config.outputs.manifest-pr-skip }}
uses: nrfconnect/action-manifest-pr@main
with:
token: ${{ secrets.NCS_GITHUB_TOKEN }}
7 changes: 2 additions & 5 deletions .github/workflows/on-pr_publish_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,8 @@ jobs:
sort current/${cfg} > current/${cfg}
tr -s '\n' < current/${cfg} > current/${cfg}
printf "\n\n%s\n%-75s|%s\n" "${cfg}" "old" "new" > tmp.md
diff --text --report-identical-files --suppress-common-lines --side-by-side --label old --label new old/${cfg} current/${cfg} >> tmp.md
if [ $? -eq 1 ]; then
cat tmp.md >> memory_usage.md
fi
printf "\n%s\n%-75s|%s\n" "${cfg}" "old" "new" >> memory_usage.md
diff --text --report-identical-files --suppress-common-lines --side-by-side --label old --label new old/${cfg} current/${cfg} >> memory_usage.md
done
echo "\`\`\`" >> memory_usage.md
echo "</details>" >> memory_usage.md
Expand Down

0 comments on commit da0a166

Please sign in to comment.