-
Notifications
You must be signed in to change notification settings - Fork 1
update workflow for automerge #128
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
4 commits
Select commit
Hold shift + click to select a range
0352aee
update workflow for automerge
adamspd d229c57
Potential fix for pull request finding 'CodeQL / Workflow does not co…
adamspd 36189c2
Potential fix for pull request finding 'CodeQL / Workflow does not co…
adamspd a696f2f
remove CodeQL analysis workflow file
adamspd 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: after-merge-dependabot | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [closed] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| if: github.event.pull_request.merged && github.actor == 'dependabot[bot]' | ||
| runs-on: ubuntu-latest | ||
| concurrency: | ||
| group: dependabot-after-merge | ||
| cancel-in-progress: true | ||
| steps: | ||
| - name: Fetch dependabot metadata | ||
| id: dependabot-metadata | ||
| uses: dependabot/fetch-metadata@v2 | ||
| with: | ||
| github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
|
||
| - uses: oprypin/find-latest-tag@v1 | ||
| id: octokit | ||
| with: | ||
| repository: ${{ github.repository }} | ||
| prefix: v | ||
|
|
||
| - name: Parse last release | ||
| id: semver_parser | ||
| uses: booxmedialtd/ws-action-parse-semver@v1 | ||
| with: | ||
| input_string: '${{ steps.octokit.outputs.tag }}' | ||
| version_extractor_regex: 'v(.*)$' | ||
|
|
||
| - name: Compute tag | ||
| id: compte_tag | ||
| run: | | ||
| major=${{ steps.semver_parser.outputs.major }} | ||
| minor=${{ steps.semver_parser.outputs.minor }} | ||
| patch=${{ steps.semver_parser.outputs.patch }} | ||
| if [ "${{ steps.dependabot-metadata.outputs.update-type }}" == "version-update:semver-minor" ]; then | ||
| minor=$((minor+1)) | ||
| patch=0 | ||
| echo "::warning::bumping minor version" | ||
| elif [ "${{ steps.dependabot-metadata.outputs.update-type }}" == "version-update:semver-patch" ]; then | ||
| patch=$((patch+1)) | ||
| echo "::warning::bumping patch version" | ||
| fi | ||
| tag="v${major}.${minor}.${patch}" | ||
| echo "::set-output name=tag::${tag}" | ||
| echo "::warning::tag == ${tag}" | ||
|
|
||
| - name: Create tag | ||
| uses: tvdias/github-tagger@v0.0.2 | ||
| if: steps.compte_tag.outputs.tag != steps.semver_parser.outputs.fullversion | ||
| with: | ||
| repo-token: "${{ secrets.AUTO_MERGE_TOKEN }}" | ||
| tag: "${{ steps.compte_tag.outputs.tag }}" | ||
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,22 @@ | ||
| name: auto-accept-dependabot | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| auto-merge: | ||
| if: github.actor == 'dependabot[bot]' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Approve and Enable Auto-Merge | ||
| run: | | ||
| gh pr review --approve "$PR_URL" | ||
| gh pr merge --auto --squash "$PR_URL" | ||
| env: | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
|---|---|---|
| @@ -1,22 +1,30 @@ | ||
| name: linter | ||
| name: golangci-lint | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| pull_request: | ||
|
|
||
| on: push | ||
| permissions: | ||
| contents: read | ||
| # Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
| # pull-requests: read | ||
|
|
||
| jobs: | ||
| linter: | ||
| golangci: | ||
| name: lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: set up go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: "1.25" | ||
|
|
||
| go-version: '>=1.26' | ||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@v7 | ||
| with: | ||
| version: latest | ||
| args: > | ||
| --enable govet | ||
| --enable staticcheck | ||
| --enable unused |
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
Oops, something went wrong.
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.