-
Notifications
You must be signed in to change notification settings - Fork 1
Add workflow for automatic rebase. #16
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
Open
DaniilKl
wants to merge
12
commits into
master
Choose a base branch
from
add-rebase-script
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8bb75cf
.github: workflows: rebase.yml: add; scripts: rebase.sh: add
DaniilKl 58e44a1
Add CI/CD workflow and a script for triggering Woodpecker workflow via
DaniilKl 382f529
.github: workflows: qubes-dom0-packagev2.yml: add qubes-component-branch
DaniilKl 0de7bf6
README.md: delete "Used by" for qubes-dom0-packagev2
DaniilKl ed96075
Address review
DaniilKl 9501536
scripts: rebase.sh: add empty commits handling
DaniilKl 2d9d77c
scripts: rebase.sh: add a note about empty commits
DaniilKl 08b43ea
.github: workflows: update actions/checkout to v6
DaniilKl e51d845
scripts: rebase.sh: Address review
DaniilKl b70dcd6
.github: workflows: rebase.yml: add rebase-exit-code output, the return
DaniilKl f4a5490
scripts: rebase.sh: add --skip
DaniilKl 8cc7730
scripts: woodpecker-trigger.sh: delete
DaniilKl 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,85 @@ | ||
| --- | ||
| name: Try rebasing on updated upstream, report in case of conflicts | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| first-remote-token: | ||
| description: > | ||
| Personal access token for performing the following operations on the | ||
| downstream-repo: fetch the repository, create a branch, delete a | ||
| branch, create commits on a branch, push to a branch, open a PR, close | ||
| a PR, get list of PRs. | ||
| required: true | ||
| inputs: | ||
| downstream-repo: | ||
| description: > | ||
| <first_repo> parameter for the rebase.sh script. | ||
| required: true | ||
| type: string | ||
| downstream-branch: | ||
| description: > | ||
| <first_repo_branch> parameter for the rebase.sh script. | ||
| required: true | ||
| type: string | ||
| upstream-repo: | ||
| description: > | ||
| <second_repo> parameter for the rebase.sh script. | ||
| required: true | ||
| type: string | ||
| upstream-branch: | ||
| description: > | ||
| <second_repo_branch> parameter for the rebase.sh script. | ||
| required: true | ||
| type: string | ||
| commit-user-name: | ||
| description: > | ||
| NAME parameter for the --upstream-branch option of the rebase.sh | ||
| script. | ||
| required: true | ||
| type: string | ||
| commit-user-email: | ||
| description: > | ||
| EMAIL parameter for the --commit-user-email option of the rebase.sh | ||
| script. | ||
| required: true | ||
| type: string | ||
| cicd-trigger-resume: | ||
| description: > | ||
| MESSAGE parameter for the --cicd-trigger-resume option of the | ||
| rebase.sh script. | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| build-and-package: | ||
| runs-on: ubuntu-latest | ||
| name: Try rebasing on updated upstream, report in case of conflicts | ||
| permissions: | ||
| # For creation/deletion/pushing to branches and creating PRs | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| repository: TrenchBoot/.github | ||
| path: shared | ||
| ref: master | ||
|
m-iwanicki marked this conversation as resolved.
Outdated
|
||
| - name: Run script for rebasing | ||
| env: | ||
| FIRST_REMOTE_TOKEN: ${{ secrets.first-remote-token }} | ||
| DOWNSTREAM_REPO: ${{ inputs.downstream-repo }} | ||
| DOWNSTREAM_BRANCH: ${{ inputs.downstream-branch }} | ||
| UPSTREAM_REPO: ${{ inputs.upstream-repo }} | ||
| UPSTREAM_BRANCH: ${{ inputs.upstream-branch }} | ||
| NAME: ${{ inputs.commit-user-name }} | ||
| EMAIL: ${{ inputs.commit-user-email }} | ||
| MESSAGE: ${{ inputs.cicd-trigger-resume }} | ||
| run: | | ||
|
m-iwanicki marked this conversation as resolved.
|
||
| shared/scripts/rebase.sh --first-remote-token "$FIRST_REMOTE_TOKEN" \ | ||
| --commit-user-name "$NAME" \ | ||
| --commit-user-email "$EMAIL" \ | ||
| --cicd-trigger-resume "$MESSAGE" \ | ||
| "$DOWNSTREAM_REPO" \ | ||
| "$DOWNSTREAM_BRANCH" \ | ||
| "$UPSTREAM_REPO" \ | ||
| "$UPSTREAM_BRANCH" | ||
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,73 @@ | ||
| name: Trigger a Woodpecker CI/CD pipeline | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| api-url: | ||
| description: > | ||
| Base URL of the Woodpecker instance, e.g. https://ci.example.com. | ||
| --api-url parameter for the woodpecker-trigger.sh script. | ||
| required: true | ||
| type: string | ||
| owner: | ||
| description: > | ||
| Repository owner (user or organization). | ||
| --owner parameter for the woodpecker-trigger.sh script. | ||
| required: true | ||
| type: string | ||
| repo: | ||
| description: > | ||
| Repository name. | ||
| --repo parameter for the woodpecker-trigger.sh script. | ||
| required: true | ||
| type: string | ||
| ref: | ||
| description: > | ||
| Branch to trigger the pipeline on. | ||
| --ref parameter for the woodpecker-trigger.sh script. | ||
| required: false | ||
| type: string | ||
| default: 'main' | ||
| inputs: | ||
| description: > | ||
| Additional --input flags to pass to woodpecker-trigger.sh, e.g. | ||
| "--input KEY=VALUE --input KEY2=VALUE2". Keys must be valid shell | ||
| variable names (no hyphens). | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| secrets: | ||
| woodpecker-token: | ||
| description: > | ||
| Woodpecker API token for triggering the pipeline. | ||
| --token parameter for the woodpecker-trigger.sh script. | ||
| required: true | ||
|
|
||
| jobs: | ||
| trigger-woodpecker: | ||
| runs-on: ubuntu-latest | ||
| name: Trigger a Woodpecker CI/CD pipeline | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
m-iwanicki marked this conversation as resolved.
Outdated
|
||
| with: | ||
| repository: TrenchBoot/.github | ||
| path: shared | ||
| ref: master | ||
| - name: Trigger Woodpecker CI/CD pipeline | ||
| env: | ||
| WOODPECKER_TOKEN: ${{ secrets.woodpecker-token }} | ||
| WOODPECKER_API_URL: ${{ inputs.api-url }} | ||
| WOODPECKER_OWNER: ${{ inputs.owner }} | ||
| WOODPECKER_REPO: ${{ inputs.repo }} | ||
| WOODPECKER_REF: ${{ inputs.ref }} | ||
| WOODPECKER_INPUTS: ${{ inputs.inputs }} | ||
| run: | | ||
| shared/scripts/woodpecker-trigger.sh \ | ||
| --token "$WOODPECKER_TOKEN" \ | ||
| --api-url "$WOODPECKER_API_URL" \ | ||
| --owner "$WOODPECKER_OWNER" \ | ||
| --repo "$WOODPECKER_REPO" \ | ||
| --ref "$WOODPECKER_REF" \ | ||
| $WOODPECKER_INPUTS | ||
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.