Closed TheQueenIsDead closed 1 year ago
I realised that I included the ref
argument on the docs step as opposed to the checkout step, user error, apologies.
I did however have to checkout the head_ref
attribute instead of the event head ref, as this would cause the repository to still be checked out in a detached state:
https://github.com/terraform-docs/gh-actions#auto-commit-changes
jobs:
...
docs:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: "Docs"
uses: ./.github/actions/docs
with:
working_directory: ./storage
Docs is just a composite action to reduce code in my monorepo
name: ""
description: ""
inputs:
working_directory:
description: "The working directory of the module to scope the docs to."
required: false
default: "."
runs:
using: "composite"
steps:
- name: "Render Docs and push changes back to PR"
uses: terraform-docs/gh-actions@main
with:
working-dir: ${{ inputs.working_directory }}
output-file: README.md
output-method: inject
git-push: "true"
This works well for me, but a user could opt to checkout the PR ref, then run git checkout xxx
in the next step.
Describe the bug
Terraform docs does not seem to check out the ref for dependabot branches
Error
Since I provided a ref (Per the config below), I would expect it to be checked out :-)
How can we reproduce it?
Create a CI run for a small dependabot version PR that has the following config: Config:
Settings:
Environment information