From ee9e2238c4db6ce8492b171787745d3a688fe31a Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:05:20 -0700 Subject: [PATCH 01/16] Update label to ignore --- .github/workflows/lint_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_pr.yml b/.github/workflows/lint_pr.yml index f3f0656..84ce774 100644 --- a/.github/workflows/lint_pr.yml +++ b/.github/workflows/lint_pr.yml @@ -17,5 +17,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: ignoreLabels: | - bot + bot-updated ignore-semantic-pull-request From 9b15b2994be3a77b2ccc9100a77b9a1badf17bb2 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:06:56 -0700 Subject: [PATCH 02/16] Check for PR label to optimize run The second run is just to complete the merge with bors --- .github/workflows/update-repo-stuff.yml | 54 ++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index f277bd6..21e0dd0 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -153,11 +153,20 @@ jobs: runs-on: ubuntu-latest needs: get_pr_info steps: + - name: Check if already labeled before running + id: label-check + uses: agilepathway/label-checker@v1.2.6 + with: + one_of: ${{ env.ADD_PR_LABELS }} + allow_failure: true + - name: Checkout + if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/checkout@v3 with: fetch-depth: 0 - name: Configure git user + if: ${{ steps.label-check.outputs.label_check != 'success' }} run: | git status git config user.name "${{ env.GIT_BOT_USERNAME }}" @@ -167,6 +176,7 @@ jobs: # uses: crazy-max/ghaction-dump-context@v1.2.1 - name: Simulate PR merge for changelog updates + if: ${{ steps.label-check.outputs.label_check != 'success' }} run: | git checkout ${{ env.DEFAULT_BRANCH }} @@ -181,6 +191,7 @@ jobs: git log -5 - name: Generate a changelog + if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: orhun/git-cliff-action@v1 id: git-cliff with: @@ -189,8 +200,10 @@ jobs: env: OUTPUT: ${{ env.CHANGELOG_FILENAME }} - name: Print the changelog + if: ${{ steps.label-check.outputs.label_check != 'success' }} run: cat "${{ steps.git-cliff.outputs.changelog }}" - name: Upload generated CHANGELOG + if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/upload-artifact@v2 with: name: ${{ env.CHANGELOG_FILENAME }} @@ -205,13 +218,36 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/staging' runs-on: ubuntu-latest steps: + - name: Check if already labeled before running + id: label-check + uses: agilepathway/label-checker@v1.2.6 + with: + one_of: ${{ env.ADD_PR_LABELS }} + allow_failure: true + - name: Checkout + if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/checkout@v3 + + - uses: actions-rs/install@v0.1 + if: ${{ steps.label-check.outputs.label_check != 'success' }} + with: + crate: cargo-msrv + version: latest + + # I took this from entrypoint.sh + # from spenserblack/actions-msrv@v0.2 - name: Get Minimum Supported Rust Version - uses: spenserblack/actions-msrv@v0.2 + if: ${{ steps.label-check.outputs.label_check != 'success' }} id: get-msrv timeout-minutes: 60 + run: | + MSRV_RESULT=$(cargo msrv --path $1 --output-format json | tail -1) + MSRV=$(echo $MSRV_RESULT | jq -r '.msrv') + echo "::set-output name=msrv::$MSRV" + - name: Create Badge + if: ${{ steps.label-check.outputs.label_check != 'success' }} run: curl https://img.shields.io/badge/rustc-${{ steps.get-msrv.outputs.msrv }}%2B-blue?logo=rust -o msrv-badge.svg - uses: actions/upload-artifact@v3 with: @@ -230,7 +266,15 @@ jobs: contents: write pull-requests: write steps: + - name: Check if already labeled before running + id: label-check + uses: agilepathway/label-checker@v1.2.6 + with: + one_of: ${{ env.ADD_PR_LABELS }} + allow_failure: true + - name: Get GH App token + if: ${{ steps.label-check.outputs.label_check != 'success' }} id: app uses: getsentry/action-github-app-token@v1 with: @@ -247,6 +291,7 @@ jobs: # uses: crazy-max/ghaction-dump-context@v1.2.1 - name: Checkout PR branch + if: ${{ steps.label-check.outputs.label_check != 'success' }} env: GH_TOKEN: ${{ steps.app.outputs.token }} run: | @@ -255,12 +300,14 @@ jobs: git status - name: Download ${{ env.CHANGELOG_FILENAME }} + if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/download-artifact@v2 with: name: ${{ env.CHANGELOG_FILENAME }} path: . - name: Download msrv-badge.svg + if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/download-artifact@v2 with: name: msrv-badge.svg @@ -272,6 +319,7 @@ jobs: # git status - name: Commit any updates to ${{ env.CHANGELOG_FILENAME }} + if: ${{ steps.label-check.outputs.label_check != 'success' }} id: auto-commit-action uses: stefanzweifel/git-auto-commit-action@v4.14.1 with: @@ -281,8 +329,10 @@ jobs: commit_author: ${{ env.GIT_BOT_USERNAME }} <${{ env.GIT_BOT_EMAIL }}> # Make sure labels are created first + # If you're using bors, remember to add your user as a reviewer + # Note: You can only add reviewer if `Synchronize` is None. - name: Wait, then restart Bors and label PR - if: ${{ steps.auto-commit-action.outputs.changes_detected == 'true' }} + if: ${{steps.label-check.outputs.label_check != 'success' || steps.auto-commit-action.outputs.changes_detected == 'true' }} env: GH_TOKEN: ${{ steps.app.outputs.token }} run: | From 26eeaa31eeb39b9b07c672986262add68df72fc8 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:15:25 -0700 Subject: [PATCH 03/16] Add GITHUB_TOKEN to the label check step --- .github/workflows/update-repo-stuff.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 21e0dd0..010eece 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -157,8 +157,10 @@ jobs: id: label-check uses: agilepathway/label-checker@v1.2.6 with: + if: ${{ steps.label-check.outputs.label_check != 'success' }} one_of: ${{ env.ADD_PR_LABELS }} allow_failure: true + repo_token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout if: ${{ steps.label-check.outputs.label_check != 'success' }} @@ -224,6 +226,7 @@ jobs: with: one_of: ${{ env.ADD_PR_LABELS }} allow_failure: true + repo_token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout if: ${{ steps.label-check.outputs.label_check != 'success' }} @@ -272,6 +275,7 @@ jobs: with: one_of: ${{ env.ADD_PR_LABELS }} allow_failure: true + repo_token: ${{ secrets.GITHUB_TOKEN }} - name: Get GH App token if: ${{ steps.label-check.outputs.label_check != 'success' }} From 8e9554b868771ae4b4f61e434c7567899d57e2c7 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:19:11 -0700 Subject: [PATCH 04/16] typo --- .github/workflows/update-repo-stuff.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 010eece..06f38b4 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -157,7 +157,6 @@ jobs: id: label-check uses: agilepathway/label-checker@v1.2.6 with: - if: ${{ steps.label-check.outputs.label_check != 'success' }} one_of: ${{ env.ADD_PR_LABELS }} allow_failure: true repo_token: ${{ secrets.GITHUB_TOKEN }} From 20cebb580b5dbcd079f1b7bd96fc3318be2d0b56 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:35:56 -0700 Subject: [PATCH 05/16] Only call label check step once --- .github/workflows/update-repo-stuff.yml | 59 ++++++++----------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 06f38b4..5256e2f 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -12,8 +12,24 @@ env: GIT_BOT_EMAIL: github-actions[bot]@users.noreply.github.com jobs: + bot-label-check: + name: Check if we've already done the hard work + runs-on: ubuntu-latest + outputs: + label-exists: ${{ steps.label-check.outputs.label_check }} + steps: + - name: Check if already labeled before running + id: label-check + uses: agilepathway/label-checker@v1.2.6 + with: + one_of: ${{ env.ADD_PR_LABELS }} + allow_failure: true + repo_token: ${{ secrets.GITHUB_TOKEN }} + get_pr_number_pr_event: name: Get the PR number from PR event + needs: bot-label-check + if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} runs-on: ubuntu-latest outputs: pr_number: ${{ steps.pr.outputs.number }} @@ -31,6 +47,8 @@ jobs: get_pr_number_push_event: name: Get the PR number from Push event + needs: bot-label-check + if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} runs-on: ubuntu-latest outputs: pr_number: ${{ steps.pr.outputs.number }} @@ -153,21 +171,11 @@ jobs: runs-on: ubuntu-latest needs: get_pr_info steps: - - name: Check if already labeled before running - id: label-check - uses: agilepathway/label-checker@v1.2.6 - with: - one_of: ${{ env.ADD_PR_LABELS }} - allow_failure: true - repo_token: ${{ secrets.GITHUB_TOKEN }} - - name: Checkout - if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/checkout@v3 with: fetch-depth: 0 - name: Configure git user - if: ${{ steps.label-check.outputs.label_check != 'success' }} run: | git status git config user.name "${{ env.GIT_BOT_USERNAME }}" @@ -177,7 +185,6 @@ jobs: # uses: crazy-max/ghaction-dump-context@v1.2.1 - name: Simulate PR merge for changelog updates - if: ${{ steps.label-check.outputs.label_check != 'success' }} run: | git checkout ${{ env.DEFAULT_BRANCH }} @@ -192,7 +199,6 @@ jobs: git log -5 - name: Generate a changelog - if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: orhun/git-cliff-action@v1 id: git-cliff with: @@ -201,10 +207,8 @@ jobs: env: OUTPUT: ${{ env.CHANGELOG_FILENAME }} - name: Print the changelog - if: ${{ steps.label-check.outputs.label_check != 'success' }} run: cat "${{ steps.git-cliff.outputs.changelog }}" - name: Upload generated CHANGELOG - if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/upload-artifact@v2 with: name: ${{ env.CHANGELOG_FILENAME }} @@ -219,20 +223,10 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/staging' runs-on: ubuntu-latest steps: - - name: Check if already labeled before running - id: label-check - uses: agilepathway/label-checker@v1.2.6 - with: - one_of: ${{ env.ADD_PR_LABELS }} - allow_failure: true - repo_token: ${{ secrets.GITHUB_TOKEN }} - - name: Checkout - if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/checkout@v3 - uses: actions-rs/install@v0.1 - if: ${{ steps.label-check.outputs.label_check != 'success' }} with: crate: cargo-msrv version: latest @@ -240,7 +234,6 @@ jobs: # I took this from entrypoint.sh # from spenserblack/actions-msrv@v0.2 - name: Get Minimum Supported Rust Version - if: ${{ steps.label-check.outputs.label_check != 'success' }} id: get-msrv timeout-minutes: 60 run: | @@ -249,7 +242,6 @@ jobs: echo "::set-output name=msrv::$MSRV" - name: Create Badge - if: ${{ steps.label-check.outputs.label_check != 'success' }} run: curl https://img.shields.io/badge/rustc-${{ steps.get-msrv.outputs.msrv }}%2B-blue?logo=rust -o msrv-badge.svg - uses: actions/upload-artifact@v3 with: @@ -268,16 +260,7 @@ jobs: contents: write pull-requests: write steps: - - name: Check if already labeled before running - id: label-check - uses: agilepathway/label-checker@v1.2.6 - with: - one_of: ${{ env.ADD_PR_LABELS }} - allow_failure: true - repo_token: ${{ secrets.GITHUB_TOKEN }} - - name: Get GH App token - if: ${{ steps.label-check.outputs.label_check != 'success' }} id: app uses: getsentry/action-github-app-token@v1 with: @@ -294,7 +277,6 @@ jobs: # uses: crazy-max/ghaction-dump-context@v1.2.1 - name: Checkout PR branch - if: ${{ steps.label-check.outputs.label_check != 'success' }} env: GH_TOKEN: ${{ steps.app.outputs.token }} run: | @@ -303,14 +285,12 @@ jobs: git status - name: Download ${{ env.CHANGELOG_FILENAME }} - if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/download-artifact@v2 with: name: ${{ env.CHANGELOG_FILENAME }} path: . - name: Download msrv-badge.svg - if: ${{ steps.label-check.outputs.label_check != 'success' }} uses: actions/download-artifact@v2 with: name: msrv-badge.svg @@ -322,7 +302,6 @@ jobs: # git status - name: Commit any updates to ${{ env.CHANGELOG_FILENAME }} - if: ${{ steps.label-check.outputs.label_check != 'success' }} id: auto-commit-action uses: stefanzweifel/git-auto-commit-action@v4.14.1 with: @@ -335,7 +314,7 @@ jobs: # If you're using bors, remember to add your user as a reviewer # Note: You can only add reviewer if `Synchronize` is None. - name: Wait, then restart Bors and label PR - if: ${{steps.label-check.outputs.label_check != 'success' || steps.auto-commit-action.outputs.changes_detected == 'true' }} + if: ${{ steps.auto-commit-action.outputs.changes_detected == 'true' }} env: GH_TOKEN: ${{ steps.app.outputs.token }} run: | From 418a8f60faaf1fa45bf899e87ce31f4ff0a249e3 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:41:02 -0700 Subject: [PATCH 06/16] Only run the update stuff during merge Removed the inner checks for bors builds too --- .github/workflows/ci.yml | 1 + .github/workflows/update-repo-stuff.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 304c354..4c4e930 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,7 @@ jobs: # message: "[skip ci] Update CHANGELOG from Github Actions" update-project-stuff: + if: github.event_name == 'push' && github.ref == 'refs/heads/staging' uses: ./.github/workflows/update-repo-stuff.yml secrets: inherit diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 5256e2f..2dc86e7 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -220,7 +220,7 @@ jobs: # possibly using labels on PR generate_msrv: name: Generate Minimum Supported Rust Version badge - if: github.event_name == 'push' && github.ref == 'refs/heads/staging' + #if: github.event_name == 'push' && github.ref == 'refs/heads/staging' runs-on: ubuntu-latest steps: - name: Checkout @@ -250,7 +250,7 @@ jobs: commit_updates: name: Commit updates - if: github.event_name == 'push' && github.ref == 'refs/heads/staging' + #if: github.event_name == 'push' && github.ref == 'refs/heads/staging' runs-on: ubuntu-latest needs: - get_pr_info From 94ab3bf6b93893371763c8c45a34607b68a588ca Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:47:27 -0700 Subject: [PATCH 07/16] MSRV generate depend on label check --- .github/workflows/update-repo-stuff.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 2dc86e7..b0f76e9 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -221,6 +221,7 @@ jobs: generate_msrv: name: Generate Minimum Supported Rust Version badge #if: github.event_name == 'push' && github.ref == 'refs/heads/staging' + needs: get_pr_info runs-on: ubuntu-latest steps: - name: Checkout From 4811f0d74f1eaaee3e7119457042cc663a93e197 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 19:58:16 -0700 Subject: [PATCH 08/16] Rearrange to give action the PR number --- .github/workflows/update-repo-stuff.yml | 39 +++++++++++++------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index b0f76e9..04abfaa 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -12,20 +12,6 @@ env: GIT_BOT_EMAIL: github-actions[bot]@users.noreply.github.com jobs: - bot-label-check: - name: Check if we've already done the hard work - runs-on: ubuntu-latest - outputs: - label-exists: ${{ steps.label-check.outputs.label_check }} - steps: - - name: Check if already labeled before running - id: label-check - uses: agilepathway/label-checker@v1.2.6 - with: - one_of: ${{ env.ADD_PR_LABELS }} - allow_failure: true - repo_token: ${{ secrets.GITHUB_TOKEN }} - get_pr_number_pr_event: name: Get the PR number from PR event needs: bot-label-check @@ -47,8 +33,6 @@ jobs: get_pr_number_push_event: name: Get the PR number from Push event - needs: bot-label-check - if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} runs-on: ubuntu-latest outputs: pr_number: ${{ steps.pr.outputs.number }} @@ -166,10 +150,26 @@ jobs: echo "::set-output name=title::$PR_TITLE" echo "pr title is: $PR_TITLE" + bot-label-check: + name: Check if we've already done the hard work + runs-on: ubuntu-latest + needs: get_pr_info + outputs: + label-exists: ${{ steps.label-check.outputs.result }} + steps: + - name: Check if already labeled before running + id: label-check + uses: paul1k/check-pr-labels@v1.0.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + pull-number: ${{ needs.get_pr_number.outputs.pr_number }} + labels: ["bot-updated"] + generate_changelog: name: Generate changelog runs-on: ubuntu-latest - needs: get_pr_info + needs: bot-label-check + if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} steps: - name: Checkout uses: actions/checkout@v3 @@ -221,7 +221,8 @@ jobs: generate_msrv: name: Generate Minimum Supported Rust Version badge #if: github.event_name == 'push' && github.ref == 'refs/heads/staging' - needs: get_pr_info + needs: bot-label-check + if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} runs-on: ubuntu-latest steps: - name: Checkout @@ -257,6 +258,8 @@ jobs: - get_pr_info - generate_changelog - generate_msrv + - bot-label-check + if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} permissions: contents: write pull-requests: write From df665c0062a6b86ef21a712bc7ac5beba7d62ccb Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 20:00:05 -0700 Subject: [PATCH 09/16] syntax --- .github/workflows/update-repo-stuff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 04abfaa..0a71c73 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -163,7 +163,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} pull-number: ${{ needs.get_pr_number.outputs.pr_number }} - labels: ["bot-updated"] + labels: '["bot-updated"]' generate_changelog: name: Generate changelog From 6e49868d3c343bd917fd742f73253f8a85656c25 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 20:06:50 -0700 Subject: [PATCH 10/16] Remove circular dep --- .github/workflows/update-repo-stuff.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 0a71c73..e5897d3 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -14,8 +14,6 @@ env: jobs: get_pr_number_pr_event: name: Get the PR number from PR event - needs: bot-label-check - if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} runs-on: ubuntu-latest outputs: pr_number: ${{ steps.pr.outputs.number }} From 221a4cd763c9687387f1d9921b50303a3cd3bdfa Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 20:13:05 -0700 Subject: [PATCH 11/16] Fix output comparison vars --- .github/workflows/update-repo-stuff.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index e5897d3..bf69bed 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -160,14 +160,14 @@ jobs: uses: paul1k/check-pr-labels@v1.0.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} - pull-number: ${{ needs.get_pr_number.outputs.pr_number }} + pull-number: ${{ needs.get_pr_info.outputs.pr_number }} labels: '["bot-updated"]' generate_changelog: name: Generate changelog runs-on: ubuntu-latest needs: bot-label-check - if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} + if: ${{ needs.bot-label-check.outputs.label-exists }} steps: - name: Checkout uses: actions/checkout@v3 @@ -220,7 +220,7 @@ jobs: name: Generate Minimum Supported Rust Version badge #if: github.event_name == 'push' && github.ref == 'refs/heads/staging' needs: bot-label-check - if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} + if: ${{ needs.bot-label-check.outputs.label-exists }} runs-on: ubuntu-latest steps: - name: Checkout @@ -257,7 +257,7 @@ jobs: - generate_changelog - generate_msrv - bot-label-check - if: ${{ needs.bot-label-check.outputs.label-exists != 'success' }} + if: ${{ needs.bot-label-check.outputs.label-exists }} permissions: contents: write pull-requests: write From 2e90f14452835b3bb8edcea76d21250926acf1bb Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 20:21:21 -0700 Subject: [PATCH 12/16] Convert string to int --- .github/workflows/update-repo-stuff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index bf69bed..f418c4d 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -160,7 +160,7 @@ jobs: uses: paul1k/check-pr-labels@v1.0.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} - pull-number: ${{ needs.get_pr_info.outputs.pr_number }} + pull-number: ${{ fromJSON(needs.get_pr_info.outputs.pr_number) }} labels: '["bot-updated"]' generate_changelog: From 19b6744f5d40e1bd399f5ada64ede85d62415f56 Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 20:30:01 -0700 Subject: [PATCH 13/16] Missed a job dependency --- .github/workflows/update-repo-stuff.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index f418c4d..46f17cc 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -166,7 +166,9 @@ jobs: generate_changelog: name: Generate changelog runs-on: ubuntu-latest - needs: bot-label-check + needs: + - bot-label-check + - get_pr_info if: ${{ needs.bot-label-check.outputs.label-exists }} steps: - name: Checkout From 1e90f781c4fce7766a8dffa6d11d06235caf587b Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 20:44:33 -0700 Subject: [PATCH 14/16] Trying another way to get cargo-msrv --- .github/workflows/update-repo-stuff.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 46f17cc..0d810c4 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -228,10 +228,13 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - uses: actions-rs/install@v0.1 + - name: rust-toolchain + uses: actions-rs/toolchain@v1.0.6 with: - crate: cargo-msrv - version: latest + profile: minimal + toolchain: stable + components: cargo-msrv + - uses: Swatinem/rust-cache@v2 # I took this from entrypoint.sh # from spenserblack/actions-msrv@v0.2 From c224cb91f7186d4ae476ce2c54e2e6bacd7c0daa Mon Sep 17 00:00:00 2001 From: "T.J. Telan" Date: Thu, 29 Sep 2022 20:48:24 -0700 Subject: [PATCH 15/16] Try again with cargo msrv --- .github/workflows/update-repo-stuff.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index 0d810c4..92dad6c 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -233,8 +233,9 @@ jobs: with: profile: minimal toolchain: stable - components: cargo-msrv - uses: Swatinem/rust-cache@v2 + - name: Install cargo-msrv + run: cargo install cargo-msrv # I took this from entrypoint.sh # from spenserblack/actions-msrv@v0.2 From 79add673661fc71729bf3d591ad50b6ed79c50b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 30 Sep 2022 03:56:57 +0000 Subject: [PATCH 16/16] Updating CHANGELOG.md and/or MSRV badge [actions skip] --- .github/assets/msrv-badge.svg | 2 +- CHANGELOG.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/assets/msrv-badge.svg b/.github/assets/msrv-badge.svg index e704d19..d3ec134 100644 --- a/.github/assets/msrv-badge.svg +++ b/.github/assets/msrv-badge.svg @@ -1 +1 @@ -rustc: 1.56.1+rustc1.56.1+ \ No newline at end of file +rustc: +rustc+ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f50e02..7f34ee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix post pr workflow ([#37](https://github.com/tjtelan/git-url-parse-rs/issues/37)) - Post PR: Include all PR files with changelog commit with `--all` ([#38](https://github.com/tjtelan/git-url-parse-rs/issues/38)) - Add dependency for update job completion before Bors merges ([#43](https://github.com/tjtelan/git-url-parse-rs/issues/43)) +- Fix post merge lint ([#45](https://github.com/tjtelan/git-url-parse-rs/issues/45)) ### Other