From 7a06883f9a8fec2ae2da726faeb4c8861ebcc4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20J=C3=A4hn?= Date: Mon, 8 Jul 2024 10:50:19 +0200 Subject: [PATCH 1/2] Use Personal access token to trigger workflows --- .github/workflows/update_datasets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_datasets.yml b/.github/workflows/update_datasets.yml index 3d58d2fc..cd0f4d31 100644 --- a/.github/workflows/update_datasets.yml +++ b/.github/workflows/update_datasets.yml @@ -46,7 +46,7 @@ jobs: if: steps.git-check.outputs.changes_detected == 'true' uses: peter-evans/create-pull-request@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} commit-message: "GitHub Action: Update datasets" title: "[AUTO] Update Datasets" body: "This is an auto-generated PR with dataset updates." From 45c9075c4d6220975cb34f7544e7a32416a285e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20J=C3=A4hn?= Date: Mon, 15 Jul 2024 11:11:22 +0200 Subject: [PATCH 2/2] Add auto-merge for datasets workflow --- .github/workflows/update_datasets.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update_datasets.yml b/.github/workflows/update_datasets.yml index cd0f4d31..eccee3f5 100644 --- a/.github/workflows/update_datasets.yml +++ b/.github/workflows/update_datasets.yml @@ -51,4 +51,25 @@ jobs: title: "[AUTO] Update Datasets" body: "This is an auto-generated PR with dataset updates." branch: "update-datasets-${{ github.run_number }}" - delete-branch: true \ No newline at end of file + delete-branch: true + + - name: Install GitHub CLI + run: | + if ! command -v gh &> /dev/null + then + echo "GitHub CLI not found, installing..." + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + sudo apt update + sudo apt install gh -y + else + echo "GitHub CLI is already installed." + fi + + - name: Enable Auto-Merge for the PR + if: steps.git-check.outputs.changes_detected == 'true' + run: | + PR_NUMBER=$(echo ${{ steps.create-pr.outputs.pull-request-number }}) + gh pr merge $PR_NUMBER --auto --merge + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} \ No newline at end of file