diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index f5bbe92..9eef49b 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -2,11 +2,8 @@ name: Test Action on: push: - branches: - - main - pull_request: - branches: - - main + branches-ignore: + - 'main' jobs: test-action: @@ -30,7 +27,7 @@ jobs: targetBranch: 'main' body: 'This is an automated pull request.' labels: 'invalid,wontfix' - assignees: 'octocat' + assignees: ${{ github.actor }} - name: Output PR URL run: echo "The PR URL is ${{ steps.create_pr.outputs.PRURL }}" diff --git a/README.md b/README.md index 0ce5d54..597d1a9 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,11 @@ inputs: outputs: PRURL: description: 'The URL of the created pull request' -``` \ No newline at end of file +``` + +## Requirements + +The following permissions must be set for the repository: + * `Settings > Actions > General` + * ![](gh_workflow_permissions.png) +*Alternative is to set [jobs..permissions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions)* \ No newline at end of file diff --git a/action.yml b/action.yml index 573a91a..63a2322 100644 --- a/action.yml +++ b/action.yml @@ -25,10 +25,12 @@ inputs: outputs: PRURL: description: 'The URL of the created pull request' + value: ${{ steps.create_pr.outputs.PR_URL }} runs: using: 'composite' steps: - name: Create Pull Request + id: create_pr shell: bash run: bash create-pr.sh env: diff --git a/create-pr.sh b/create-pr.sh index 2a5ff2a..b04b0d7 100644 --- a/create-pr.sh +++ b/create-pr.sh @@ -13,4 +13,4 @@ PR_OUTPUT=$(gh pr create \ PR_URL=$(echo "$PR_OUTPUT" | grep -o 'https://github.com/[^ ]*') # Set the PR URL as the output -echo "name=$PR_URL" >> $GITHUB_OUTPUT +echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT diff --git a/gh_workflow_permissions.png b/gh_workflow_permissions.png new file mode 100644 index 0000000..5cea0a8 Binary files /dev/null and b/gh_workflow_permissions.png differ