Repository navigation
Add push event trigger to on_pr.yml workflow (#5) #7
This file contains hidden or 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: on PR | |
| # Controls when the workflow will run | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| jobs: | |
| build1: | |
| if: ${{ github.event.label.name == 'trigger-ci' }} | |
| runs-on: ubuntu-latest | |
| # if: false | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Run a one-line script | |
| run: echo -e "## Report 1 \ntest1" > report_build1.md | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: report_build1 | |
| path: report_build1.md | |
| - run: cat aaaaa.txt | |
| build2: | |
| if: ${{ github.event.label.name == 'trigger-ci' }} | |
| runs-on: ubuntu-latest | |
| # if: false | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Run a one-line script | |
| run: echo -e "## Report 2 \ntest2" > report_build2.md | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: report_build2 | |
| path: report_build2.md | |
| build3: | |
| runs-on: ubuntu-latest | |
| # if: false | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Run a one-line script | |
| run: echo -e "## Report 3 \ntest3" > report_a_precommit.md | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: report_build3 | |
| path: report_a_precommit.md | |
| build5: | |
| runs-on: ubuntu-latest | |
| # if: false | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Run a one-line script | |
| run: echo -e "## Comment a \ntesta" > pr_comment_a.md | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: pr_comment_a | |
| path: pr_comment_a.md | |
| build4: | |
| runs-on: ubuntu-latest | |
| # if: false | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Run a one-line script | |
| run: echo -e "## Report 4 \ntest4" > report_aa_test.md | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: report_build4 | |
| path: report_aa_test.md | |
| upload_pr_detail: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Save PR number | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| run: | | |
| mkdir -p ./pr | |
| echo $PR_NUMBER > ./pr_number.txt | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: report_pr_number | |
| path: ./pr_number.txt | |
| email_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Extract author email | |
| id: author | |
| run: | | |
| git log -1 | |
| echo "email=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT | |
| - name: Show email | |
| run: echo "Commiter email is ${{ steps.author.outputs.email }}" > report______email.md | |
| - name: Validate author email | |
| if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }} | |
| run: echo "You are using github private e-mail. This prevent proper tracing of who contributed what, please disable it (see [Keep my email addresses private](https://github.com/settings/emails))." >> report______email.md | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: report_email | |
| path: ./report______email.md |