From e3b813a3bbc2d9e743c1b7fa940fdc1d8c2eb061 Mon Sep 17 00:00:00 2001 From: jhongturney Date: Mon, 5 Feb 2024 12:57:32 -0800 Subject: [PATCH 1/3] Create add-dependabot-pr-to-project.yml --- .../add-dependabot-pr-to-project.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/add-dependabot-pr-to-project.yml diff --git a/.github/workflows/add-dependabot-pr-to-project.yml b/.github/workflows/add-dependabot-pr-to-project.yml new file mode 100644 index 00000000..f7233a68 --- /dev/null +++ b/.github/workflows/add-dependabot-pr-to-project.yml @@ -0,0 +1,20 @@ +name: Assign Dependabot PR to Compute Foundation Project + +on: + workflow_dispatch: + pull_request: + types: [opened, reopened, labeled] + +env: + ADD_TO_PROJECT_PAT: ${{ secrets.ADD_TO_PROJECT_PAT }} + +jobs: + add-to-project: + name: Add to Compute Foundation Project Board + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.5.0 + with: + project-url: https://github.com/orgs/github/projects/5753/ # Compute Foundation Project Board + github-token: ${{ env.ADD_TO_PROJECT_PAT }} + labeled: dependencies From e413d5644bc5180283aa2262f3bb87bc59eb97f9 Mon Sep 17 00:00:00 2001 From: jhongturney Date: Tue, 6 Feb 2024 13:50:43 -0800 Subject: [PATCH 2/3] Fix action --- .github/workflows/add-dependabot-pr-to-project.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/add-dependabot-pr-to-project.yml b/.github/workflows/add-dependabot-pr-to-project.yml index f7233a68..115aa6c3 100644 --- a/.github/workflows/add-dependabot-pr-to-project.yml +++ b/.github/workflows/add-dependabot-pr-to-project.yml @@ -1,3 +1,4 @@ +--- name: Assign Dependabot PR to Compute Foundation Project on: @@ -5,8 +6,9 @@ on: pull_request: types: [opened, reopened, labeled] -env: - ADD_TO_PROJECT_PAT: ${{ secrets.ADD_TO_PROJECT_PAT }} +permissions: + contents: read + pull-requests: write jobs: add-to-project: @@ -16,5 +18,5 @@ jobs: - uses: actions/add-to-project@v0.5.0 with: project-url: https://github.com/orgs/github/projects/5753/ # Compute Foundation Project Board - github-token: ${{ env.ADD_TO_PROJECT_PAT }} - labeled: dependencies + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} + labeled: dependencies,external-dependency From 2aaa6e865cba3f8dc54edeb94d3d157fb9c252a5 Mon Sep 17 00:00:00 2001 From: jhongturney Date: Tue, 6 Feb 2024 13:51:00 -0800 Subject: [PATCH 3/3] Replace static config with template --- .github/dependabot.template.yml | 27 +++++++++++++++++++++++ .github/workflows/generate-dependabot.yml | 27 +++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/dependabot.template.yml create mode 100644 .github/workflows/generate-dependabot.yml diff --git a/.github/dependabot.template.yml b/.github/dependabot.template.yml new file mode 100644 index 00000000..652cbe92 --- /dev/null +++ b/.github/dependabot.template.yml @@ -0,0 +1,27 @@ +--- +version: 2 +registries: + ghcr: + type: docker-registry + url: ghcr.io + username: PAT + password: ${{ secrets.CONTAINER_BUILDER_TOKEN }} +updates: + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 20 + vendor: true + - package-ecosystem: "docker" + directory: "/" + registries: + - ghcr + schedule: + interval: "daily" + open-pull-requests-limit: 20 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 20 diff --git a/.github/workflows/generate-dependabot.yml b/.github/workflows/generate-dependabot.yml new file mode 100644 index 00000000..3519fe7e --- /dev/null +++ b/.github/workflows/generate-dependabot.yml @@ -0,0 +1,27 @@ +--- +name: Generate dependabot.yml + +on: + push: + repository_dispatch: + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + generate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Generate dependabot.yml + uses: Makeshift/generate-dependabot-glob-action@5cd45385ce6519f68d574aab9699832b3a5e5031 # v1.3.4 + + - name: Create Pull Request + uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0 + with: + title: '[Automated] Update dependabot.yml' + body: | + This PR was automatically generated by the generate-dependabot.yml workflow.