From a2505b3f7e70ace69ee2cc40b8fb11bfd5a42c1e Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Mon, 16 Dec 2024 16:59:17 +0000 Subject: [PATCH] CI: add lockfile update action to manually trigger for dependabot PRs (#3647) I tested it [here](https://github.com/xdslproject/xdsl/pull/3646) and it works if you do the dumb thing and trigger on push, but it seems to not run actions on unsigned commits by default. I'm hoping that if we trigger the action manually it'll inherit the clicker's permissions and re-run the action. In either case, I think whatever we adopt should supercede the cron job one as we want to never be out of sync between the pyproject and lockfile. --- .github/workflows/update-bot.yml | 38 ----------------------- .github/workflows/update-lockfile-bot.yml | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/update-bot.yml create mode 100644 .github/workflows/update-lockfile-bot.yml diff --git a/.github/workflows/update-bot.yml b/.github/workflows/update-bot.yml deleted file mode 100644 index f05c4f0d5c..0000000000 --- a/.github/workflows/update-bot.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Update Bot - -on: - workflow_dispatch: - # Set the schedule, every week at 8:00am on Monday - schedule: - - cron: 0 8 * * 1 - -permissions: - contents: write - pull-requests: write - -jobs: - lock: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: astral-sh/setup-uv@v3 - - - run: | - echo "\`\`\`" > uv_output.md - uv lock &>> uv_output.md - echo "\`\`\`" >> uv_output.md - - - name: Create pull request - uses: peter-evans/create-pull-request@v7 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update uv lockfile - title: Update uv lockfile - body-path: uv_output.md - branch: update-uv - base: main - labels: install - delete-branch: true - add-paths: uv.lock - assignees: math-fehr, georgebisbas, superlopuh diff --git a/.github/workflows/update-lockfile-bot.yml b/.github/workflows/update-lockfile-bot.yml new file mode 100644 index 0000000000..93c5bf1b4e --- /dev/null +++ b/.github/workflows/update-lockfile-bot.yml @@ -0,0 +1,32 @@ +name: Update Lockfile Bot + +on: + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Set up Python + run: uv python install 3.12 + + - name: Install the package locally and update lockfile + run: | + # Install all default extras. + XDSL_VERSION_OVERRIDE="0+dynamic" make venv + + - uses: EndBug/add-and-commit@v9 + with: + add: uv.lock