Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/assets/msrv-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
ignoreLabels: |
bot
bot-updated
ignore-semantic-pull-request
48 changes: 44 additions & 4 deletions .github/workflows/update-repo-stuff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down