Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PAT #3933

Merged
merged 3 commits into from
Sep 20, 2024
Merged

Use PAT #3933

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading