Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oxve committed Nov 14, 2023
1 parent ac60301 commit 35c28eb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/label-cherry-pick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,30 +118,28 @@ jobs:
Refer to the original PR: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}
${{ github.event.pull_request.body }}
- name: Comment on failure
uses: actions/github-script@v6
env:
DEST_PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
with:
github-token: ${{ secrets.CHERRY_PICK_TOKEN }}
script: |
console.log(github);
console.log(github.event);
console.log(context);
const { DEST_PR_NUMBER } = process.env
if (DEST_PR_NUMBER != '') {
if (!'${{ steps.create-pr.outputs.pull-request-number }}') {
// Comment on the originating PR if creating a cherry pick PR failed.
github.issues.createComment({
issue_number: github.event.number,
github.rest.issues.createComment({
issue_number: context.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '> [!IMPORTANT]\n> Creating the cherry pick PR failed! Check the log at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}.'
});
} else if ('${{ steps.cherry-pick.outcome }}' == 'failure') {
// Comment on the new PR if the cherry pick failed.
github.issues.createComment({
issue_number: DEST_PR_NUMBER,
github.rest.issues.createComment({
issue_number: '${{ steps.create-pr.outputs.pull-request-number }}',
owner: context.repo.owner,
repo: context.repo.repo,
body: '> [!IMPORTANT]\n> The cherry-pick failed! Check out the PR branch (${{ matrix.target_branch }}-${{ github.event.pull_request.number }}) and fix the conflicts before proceeding.'
Expand Down

0 comments on commit 35c28eb

Please sign in to comment.