Add derivative warning #526
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Add derivative warning | |
on: | |
workflow_run: | |
workflows: ["Check derivatives change"] | |
types: | |
- completed | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
addDerivativeChangeWarning: | |
runs-on: ubuntu-latest | |
name: Add warning if derivative change was detected | |
if: github.event.workflow_run.event == 'pull_request' | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
name: check_derivatives_change | |
workflow: check_derivatives_change.yml | |
run_id: ${{github.event.workflow_run.id }} | |
- name: Retrieve derivative check result from artifacts | |
id: changed | |
run: | | |
derivative_files_changed=`cat derivative_files_changed` | |
echo "derivative_files_changed=${derivative_files_changed}" >> "${GITHUB_OUTPUT}" | |
issue_number=`cat issue_number` | |
echo "issue_number=${issue_number}" >> "${GITHUB_OUTPUT}" | |
- if: steps.changed.outputs.derivative_files_changed == 'true' | |
run: | | |
echo "WARNING_MSG<<EOF" >> $GITHUB_ENV | |
echo "$(cat READ_BEFORE_MAKING_CHANGES.md | tail -n +3)" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Post derivative databases change warning | |
if: steps.changed.outputs.derivative_files_changed == 'true' | |
uses: thollander/[email protected] | |
with: | |
message: | | |
${{ env.WARNING_MSG }} | |
comment_tag: execution | |
pr_number: ${{ steps.changed.outputs.issue_number }} |