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

[WIP] Add actions on comments #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
23 changes: 22 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ inputs:
required: false
type: string
default: manifest-pr-skip
create-pr-comment-string:
required: false
type: string
default: 'action-manifest-pr please create manifest-PR'
rebase-comment-string:
required: false
type: string
default: 'action-manifest-pr please rebase'
manifest-pr-title-details:
required: false
type: string
Expand Down Expand Up @@ -115,7 +123,9 @@ runs:

# create actual manifest PR
- name: Commit changed west.yml and create PR
if: ${{ github.event.action == 'opened' }}
if: ${{ github.event.action == 'opened' }} ||
( ${{ github.event.action == 'created' }} && ${{ github.event.issue.pull_request }} &&
contains(github.event.comment, inputs.create-pr-comment-string)) )
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
Expand Down Expand Up @@ -166,3 +176,14 @@ runs:
set -e
if (( $has_conflict == 1)) ; then git rebase upstream/main -X theirs ; fi
git push origin auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}:auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }} -f

- name: Rebase manifest-PR on comment
if: ${{ github.event.action == 'created' }} && ${{ github.event.issue.pull_request }} &&
contains(github.event.comment, inputs.rebase-comment-string)) )
shell: bash
run: |
git checkout auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}
git remote add upstream https://github.com/${{ inputs.target-repo }}
git fetch upstream
git rebase upstream/main -X theirs
git push origin auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }}:auto-manifest-${{ github.event.repository.name }}-${{ github.event.pull_request.number }} -f