.github/workflows/token.yml #10
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
on: | |
workflow_dispatch | |
permissions: write-all | |
jobs: | |
minimal-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current Repo | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
repository: flutter/flutter | |
token: ${{ github.token }} | |
path: flutter | |
- name: Write some randome file | |
id: create-pr | |
run: | | |
cd flutter | |
touch empty.json | |
- name: Comment on original PR with CP PR link | |
if: ${{ steps.create-pr.conclusion == 'success' }} | |
run: | | |
gh issue comment 9 -R XilaiZhang/miscellaneous-side-project -b "if statement one" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Comment on original PR second IF | |
if: ${{ steps.create-pr.conclusion == 'success' }} | |
run: | | |
gh issue comment 9 -R XilaiZhang/miscellaneous-side-project -b "second if statement" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Shouldn't Comment on original PR if fail | |
if: ${{ failure() && steps.create-pr.conclusion == 'failure' }} | |
run: | | |
gh issue comment 9 -R XilaiZhang/miscellaneous-side-project -b "NOT EXPECTED" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Intentional failure | |
id: exception | |
run: | | |
exit 1 | |
- name: Test excpetion if success 1 | |
if: ${{ steps.create-pr.conclusion == 'success' }} | |
run: | | |
gh issue comment 9 -R XilaiZhang/miscellaneous-side-project -b "exception one" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Test excpetion if success 2 | |
if: ${{ steps.create-pr.conclusion == 'success' }} | |
run: | | |
gh issue comment 9 -R XilaiZhang/miscellaneous-side-project -b "exception two" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: exception should comment | |
if: ${{ failure() && steps.create-pr.conclusion == 'failure' }} | |
run: | | |
gh issue comment 9 -R XilaiZhang/miscellaneous-side-project -b "should comment" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} |