1
Fork 0

Revert cargo update changes

This commit is contained in:
clubby789 2024-03-26 00:50:20 +00:00
parent 5f2c7d2bfd
commit c2de5aff71

View file

@ -6,8 +6,6 @@ on:
schedule: schedule:
# Run weekly # Run weekly
- cron: '0 0 * * Sun' - cron: '0 0 * * Sun'
# Re-bump deps every 4 hours
- cron: '0 */4 * * *'
workflow_dispatch: workflow_dispatch:
# Needed so we can run it manually # Needed so we can run it manually
permissions: permissions:
@ -42,7 +40,7 @@ jobs:
# Exit with error if open and S-waiting-on-bors # Exit with error if open and S-waiting-on-bors
if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then
gh run cancel ${{ github.run_id }} exit 1
fi fi
update: update:
@ -65,10 +63,7 @@ jobs:
- name: cargo update - name: cargo update
# Remove first line that always just says "Updating crates.io index" # Remove first line that always just says "Updating crates.io index"
# If there are no changes, cancel the job here run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
run: |
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
git status --porcelain | grep -q Cargo.lock || gh run cancel ${{ github.run_id }}
- name: upload Cargo.lock artifact for use in PR - name: upload Cargo.lock artifact for use in PR
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -95,11 +90,11 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: download Cargo.lock from update job - name: download Cargo.lock from update job
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: Cargo-lock name: Cargo-lock
- name: download cargo-update log from update job - name: download cargo-update log from update job
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: cargo-updates name: cargo-updates
@ -134,14 +129,14 @@ jobs:
# Exit with error if PR is closed # Exit with error if PR is closed
STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state') STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state')
if [[ "$STATE" != "OPEN" ]]; then if [[ "$STATE" != "OPEN" ]]; then
gh run cancel ${{ github.run_id }} exit 1
fi fi
gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY
- name: open new pull request - name: open new pull request
# Only run if there wasn't an existing PR and if this is the weekly run # Only run if there wasn't an existing PR
if: steps.edit.outcome != 'success' && github.event.schedule == '0 0 * * Sun' if: steps.edit.outcome != 'success'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr create --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY run: gh pr create --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY