Skip to content

Commit

Permalink
Merge pull request #3933 from DataDog/tonycthsu/pat
Browse files Browse the repository at this point in the history
Use PAT
  • Loading branch information
TonyCTHsu authored Sep 20, 2024
2 parents a91f0c4 + 0e07e43 commit e163c21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/lock-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,18 @@ jobs:
with:
name: lock-dependency-${{ github.run_id }}-${{ matrix.engine.name }}-${{ matrix.engine.version }}
path: gemfiles/${{ matrix.engine.name }}_${{ matrix.engine.version }}*
retention-days: 1

# TODO: Change token to trigger workflow automation
# > New commit by GITHUB_TOKEN does not trigger workflow automation to prevent infinite loop
commit:
name: Commit changes
needs: lock
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GHA_PAT }}
- uses: actions/download-artifact@v4
with:
path: gemfiles
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Auto-update Gemfiles
name: "Update Latest Dependency"

on:
schedule:
- cron: '0 0 * * 0' # Every Sunday at midnight
push:
branches:
- quinna/update-gemfiles-workflow # TODO: remove, for testing
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -64,15 +61,11 @@ jobs:
with:
name: 'gha${{ github.run_id }}-datadog-gem-${{ matrix.engine.name }}-${{ matrix.engine.version }}'
path: gemfiles/${{ matrix.engine.name }}_${{ matrix.engine.version }}_*
retention-days: 3
retention-days: 1

aggregate:
needs: build
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -83,23 +76,20 @@ jobs:
path: gemfiles
pattern: gha${{ github.run_id }}-datadog-gem-*
merge-multiple: true

- run: git diff

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: update-latest-gemfiles
commit-message: "update latest gemfiles, workflow run: ${{ github.run_id }}"
delete-branch: true
token: ${{ secrets.GHA_PAT }}
branch: auto-generate/update-latest-dependencies
title: '[🤖] Update Latest Dependency'
base: master
title: 'Update Latest Gemfiles'
labels: dev/internal, integrations
commit-message: "[🤖] Update Latest Dependency: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
delete-branch: true
body: |
This is an auto-generated PR from 'Auto-update Gemfiles' workflow.
The PR updates the integration gemfiles to latest versions of dependencies.
Merge if green, otherwise add to backlog.
_This is an auto-generated PR from [here](https://github.com/DataDog/dd-trace-rb/blob/master/.github/workflows/update-latest-dependency.yml), which creates a pull request that will be continually updated with new changes until it is merged or closed)_
The default behavior is to create a pull request that will be continually updated with new changes
until it is merged or closed.
The PR updates latest versions of defined dependencies. Please review the changes and merge when ready.

0 comments on commit e163c21

Please sign in to comment.