From ee306eae2ba91ebcdc41aea773ac08e70a0669aa Mon Sep 17 00:00:00 2001 From: "Satadru Pramanik, DO, MPH, MEng" Date: Sun, 13 Jul 2025 11:05:34 -0400 Subject: [PATCH] More Workflow Cleanup. (#12182) Signed-off-by: Satadru Pramanik --- .github/workflows/Build.yml | 2 +- .github/workflows/No-Compile-Needed.yml | 26 +++++++++++++++++-------- .github/workflows/Repology.yml | 2 -- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index dc63a04931..869e0d0c04 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -370,7 +370,7 @@ jobs: echo -e "&& yes | crew upgrade\n\`\`\`" >> /tmp/pr.txt cat /tmp/pr.txt gh auth status >/dev/null 2>&1 || export GH_TOKEN="${GH_BACKUP_TOKEN}" - PR_NUMBER=$(gh pr create --title "AutoBuild: ${{ env.BRANCH }} started at ${TIMESTAMP}" -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) + PR_NUMBER=$(gh pr create --title "AutoBuild: ${{ env.BRANCH }} started at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) echo "PR_NUMBER is ${PR_NUMBER}" echo "PR_NUMBER=${PR_NUMBER}" >> "$GITHUB_ENV" - name: Trigger Unit Test Workflow & Add Reviewer Team diff --git a/.github/workflows/No-Compile-Needed.yml b/.github/workflows/No-Compile-Needed.yml index 573082c40a..6a71049e78 100644 --- a/.github/workflows/No-Compile-Needed.yml +++ b/.github/workflows/No-Compile-Needed.yml @@ -149,15 +149,15 @@ jobs: matrix: arch: [i686, x86_64, armv7l] runner: - - [self-hosted, X64] - - [self-hosted, ARM] + - ubuntu-24.04 + - ubuntu-24.04-arm exclude: - arch: x86_64 - runner: [self-hosted, ARM] + runner: ubuntu-24.04-arm - arch: i686 - runner: [self-hosted, ARM] + runner: ubuntu-24.04-arm - arch: armv7l - runner: [self-hosted, X64] + runner: ubuntu-24.04 runs-on: ${{ matrix.runner }} needs: setup env: @@ -332,10 +332,19 @@ jobs: git reset --hard "origin/${{ env.BRANCH }}" git pull --rebase origin master && git push -f git log --oneline -10 + - name: Get GH Token + id: get_workflow_token + uses: peter-murray/workflow-application-token-action@v4 + with: + application_id: ${{ secrets.APPLICATION_ID }} + application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} + organization: chromebrew + revoke_token: true - name: Create Pull Request env: CHANGED_MANIFEST_FILES: ${{ steps.changed-manifest-files.outputs.all_changed_files }} CHANGED_PACKAGES: ${{ needs.setup.outputs.changed_packages }} + GH_BACKUP_TOKEN: ${{ steps.get_workflow_token.outputs.token }} TIMESTAMP: ${{ needs.setup.outputs.timestamp }} i686_PACKAGES: ${{ needs.setup.outputs.i686_packages }} x86_64_PACKAGES: ${{ needs.setup.outputs.x86_64_packages }} @@ -360,14 +369,15 @@ jobs: echo -e "CREW_REPO=https://github.com/chromebrew/chromebrew.git CREW_BRANCH=${{ env.BRANCH }} crew update \\" >> /tmp/pr.txt echo -e "&& yes | crew upgrade\n\`\`\`" >> /tmp/pr.txt cat /tmp/pr.txt - PR_NUMBER=$(gh pr create --title "AutoUpdate: ${{ env.BRANCH }} started at ${TIMESTAMP}" -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) + gh auth status >/dev/null 2>&1 || export GH_TOKEN="${GH_BACKUP_TOKEN}" + PR_NUMBER=$(gh pr create --title "AutoUpdate: ${{ env.BRANCH }} started at ${TIMESTAMP}." -F /tmp/pr.txt | rev | cut -d"/" -f1 | rev) echo "PR_NUMBER is ${PR_NUMBER}" echo "PR_NUMBER=${PR_NUMBER}" >> "$GITHUB_ENV" - name: Trigger Unit Test Workflow & Add Reviewer Team env: + GH_BACKUP_TOKEN: ${{ steps.get_workflow_token.outputs.token }} GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} run: | - echo "Flipping pr ${PR_NUMBER} state." - gh pr close "${PR_NUMBER}" && gh pr reopen "${PR_NUMBER}" + gh auth status >/dev/null 2>&1 || export GH_TOKEN="${GH_BACKUP_TOKEN}" gh pr edit "${PR_NUMBER}" --add-reviewer chromebrew/active gh pr merge "${PR_NUMBER}" --auto diff --git a/.github/workflows/Repology.yml b/.github/workflows/Repology.yml index e4b012dfad..5bbc511a7c 100644 --- a/.github/workflows/Repology.yml +++ b/.github/workflows/Repology.yml @@ -43,7 +43,5 @@ jobs: GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} run: | - echo "Flipping pr ${PR_NUMBER} state." - gh pr close "${PR_NUMBER}" && gh pr reopen "${PR_NUMBER}" gh pr edit "${PR_NUMBER}" --add-reviewer chromebrew/active gh pr merge "${PR_NUMBER}" --auto --squash