diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7013360..a003071 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,5 +10,5 @@ permissions: jobs: github-action: - uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main + uses: cloudposse-github-actions/.github/.github/workflows/shared-release-branches.yml@main secrets: inherit diff --git a/action.yml b/action.yml index c76a76d..dbe984a 100644 --- a/action.yml +++ b/action.yml @@ -90,13 +90,17 @@ inputs: description: "The title to use when creating a Pull Request (when commit_method: pr)" pr_labels: - description: "Whitespace-separated list of labels to apply to Pull Requests (when commit_method: pr)" + description: "Whitespace-separated list of labels to apply to Pull Requests (when commit_method: pr or ( commit_method: commit and github context is a PR) ))" required: false default: | auto-update no-release readme + sign-commits: + description: 'Sign commits for `pr` commit_method as `github-actions[bot]` when using `GITHUB_TOKEN`, or your own bot when using GitHub App tokens.' + default: 'false' + atmos-version: description: The version of atmos to install required: false @@ -109,7 +113,10 @@ outputs: readme_file: description: "Generated README file path (if readme_enabled: true)" value: "${{ steps.readme.outputs.file }}" - + + changes_detected: + description: "Changes detected" + value: "${{ steps.auto-commit.outputs.changes_detected || steps.auto-pr.outputs.pull-request-number != false }}" runs: using: "composite" steps: @@ -238,7 +245,7 @@ runs: - uses: gaurav-nelson/github-action-markdown-link-check@v1 if: inputs.readme_enabled == 'true' && inputs.validate_readme == 'true' with: - file-path: ${{ steps.readme.outputs.file }} + file-path: '${{ steps.readme.outputs.file }} **/README.md' check-modified-files-only: true max-depth: 0 @@ -255,7 +262,19 @@ runs: commit_author: "${{ inputs.commit_author }}" file_pattern: '${{ steps.banner.outputs.file }} ${{ steps.readme.outputs.file }}' push_options: '${{ inputs.commit_push_options }}' - + + - uses: actions/github-script@v7 + if: steps.auto-commit.outputs.changes_detected == 'true' && inputs.commit_method == 'commit' && github.event_name == 'pull_request' + with: + script: | + labels = '${{ inputs.pr_labels }}'.split(' ') + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: labels + }) + - name: Add Image to Step Summary if: steps.auto-commit.outputs.changes_detected == 'true' && inputs.banner_enabled == 'true' && inputs.commit_method == 'commit' shell: bash @@ -272,18 +291,19 @@ runs: - name: Create Pull Request if: inputs.commit_method == 'pr' - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 id: auto-pr with: title: ${{ inputs.pr_title }} author: ${{ inputs.commit_author }} commit-message: ${{ inputs.commit_message }} committer: ${{ inputs.commit_author }} + sign-commits: ${{ inputs.sign-commits }} add-paths: | ${{ steps.banner.outputs.file }} ${{ steps.readme.outputs.file }} + **/README.md docs/* - body: |- ## what This is an auto-generated PR that updates the README.md and docs