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/.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/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 diff --git a/.github/workflows/update-repo-stuff.yml b/.github/workflows/update-repo-stuff.yml index f277bd6..92dad6c 100644 --- a/.github/workflows/update-repo-stuff.yml +++ b/.github/workflows/update-repo-stuff.yml @@ -148,10 +148,28 @@ 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: ${{ fromJSON(needs.get_pr_info.outputs.pr_number) }} + labels: '["bot-updated"]' + generate_changelog: name: Generate changelog runs-on: ubuntu-latest - needs: get_pr_info + needs: + - bot-label-check + - get_pr_info + if: ${{ needs.bot-label-check.outputs.label-exists }} steps: - name: Checkout uses: actions/checkout@v3 @@ -202,15 +220,33 @@ 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' + needs: bot-label-check + if: ${{ needs.bot-label-check.outputs.label-exists }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 + + - name: rust-toolchain + uses: actions-rs/toolchain@v1.0.6 + with: + profile: minimal + toolchain: stable + - 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 - name: Get Minimum Supported Rust Version - uses: spenserblack/actions-msrv@v0.2 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 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 @@ -220,12 +256,14 @@ 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 - generate_changelog - generate_msrv + - bot-label-check + if: ${{ needs.bot-label-check.outputs.label-exists }} permissions: contents: write pull-requests: write @@ -281,6 +319,8 @@ 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' }} env: 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