From 304ca27e4b075e5e00b1ecc2f9f2b10cd670faae Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Mon, 9 Dec 2024 14:49:34 +0100 Subject: [PATCH] gh workflow test --- .github/workflows/auto-merge.yaml | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/auto-merge.yaml diff --git a/.github/workflows/auto-merge.yaml b/.github/workflows/auto-merge.yaml new file mode 100644 index 0000000..8113512 --- /dev/null +++ b/.github/workflows/auto-merge.yaml @@ -0,0 +1,43 @@ +name: auto-merge + +on: + workflow_dispatch: {} +# schedule: +# - cron: "5 3 * * *" + +jobs: + run-auto-merge: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: 'release-tools' + - uses: cachix/install-nix-action@v21 + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.AUTO_MERGE_APP_ID }} + private-key: ${{ secrets.AUTO_MERGE_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + - run: | + echo "::add-mask::${{steps.app-token.outputs.token}}" + - name: Get GitHub App User ID + id: get-user-id + run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + - run: | + git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' + git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>' + - name: build release tooling + run: | + nix build ./release-tools# + - run: | + echo '{ "test": "bar" }' > auto-merge-status.json + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + - uses: actions/upload-artifact@v4 + with: + name: status-json + path: auto-merge-status.json + if-no-files-found: error \ No newline at end of file