generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 14
feat(github): add upgrade main workflow #33
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6d2a6b6
feat(github): add upgrade main workflow
krokoko dc0e91f
chore: update permissions
krokoko 40a4a9a
chore(github): update token name
krokoko 303dd5d
Merge branch 'main' into upgrade-main-workflow
krokoko bd57b13
chore(workflow): contributor statement exclusion
krokoko 1bd4afa
Merge branch 'upgrade-main-workflow' of https://github.com/krokoko/ag…
krokoko 1607ea4
Merge branch 'main' into upgrade-main-workflow
krokoko 2b367ec
Merge branch 'main' into upgrade-main-workflow
theagenticguy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| name: upgrade-main | ||
|
|
||
| on: | ||
| workflow_dispatch: {} | ||
| schedule: | ||
| - cron: "0 0 * * *" | ||
|
|
||
| permissions: | ||
| actions: none | ||
| attestations: none | ||
| checks: none | ||
| contents: none | ||
| deployments: none | ||
| discussions: none | ||
| id-token: none | ||
| issues: none | ||
| models: none | ||
| packages: none | ||
| pages: none | ||
| pull-requests: none | ||
| repository-projects: none | ||
| security-events: none | ||
| statuses: none | ||
|
|
||
| jobs: | ||
| upgrade: | ||
| name: Upgrade | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| patch_created: ${{ steps.create_patch.outputs.patch_created }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: main | ||
|
|
||
| - name: Setup mise | ||
| uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 | ||
| with: | ||
| cache: true | ||
|
|
||
| - name: Install tools | ||
| run: mise install | ||
|
|
||
| - name: Upgrade dependencies | ||
| run: mise upgrade --bump | ||
|
|
||
| - name: Find mutations | ||
| id: create_patch | ||
| run: |- | ||
| git add . | ||
| git diff --staged --patch --exit-code > repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT | ||
| shell: bash | ||
| working-directory: ./ | ||
|
|
||
| - name: Upload patch | ||
| if: steps.create_patch.outputs.patch_created | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.4.0 | ||
| with: | ||
| name: repo.patch | ||
| path: repo.patch | ||
| overwrite: true | ||
|
|
||
| pr: | ||
| name: Create Pull Request | ||
| needs: upgrade | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| if: ${{ needs.upgrade.outputs.patch_created }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: main | ||
|
|
||
| - name: Download patch | ||
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4.1.7 | ||
| with: | ||
| name: repo.patch | ||
| path: ${{ runner.temp }} | ||
|
|
||
| - name: Apply patch | ||
| run: | | ||
| [ -s ${{ runner.temp }}/repo.patch ] && git apply ${{ runner.temp }}/repo.patch || echo "Empty patch. Skipping." | ||
|
|
||
| - name: Set git identity | ||
| run: |- | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
scottschreckengaust marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v6 | ||
| with: | ||
| token: ${{ secrets.UPGRADE_MAIN_TOKEN }} | ||
| commit-message: |- | ||
| chore(deps): upgrade dependencies | ||
|
|
||
| Upgrades project dependencies. See details in [workflow run]. | ||
|
|
||
| [Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
|
|
||
| ------ | ||
|
|
||
| *Automatically created by the "upgrade-main" workflow* | ||
| branch: github-actions/upgrade-main | ||
| title: "chore(deps): upgrade dependencies" | ||
| body: |- | ||
| Upgrades project dependencies. See details in [workflow run]. | ||
|
|
||
| [Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
|
|
||
| ------ | ||
|
|
||
| *Automatically created by the "upgrade-main" workflow* | ||
| author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
| committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | ||
scottschreckengaust marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| signoff: true | ||
| labels: dependencies | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.