2023-12-08 06:56:51 -05:00
|
|
|
name: Sync Terraform provider docs
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- "terraform-provider-constellation/docs/**"
|
|
|
|
- ".github/workflows/sync-terraform-provider-docs.yml"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
sync-docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
steps:
|
|
|
|
- name: Checkout constellation repo
|
2024-05-24 05:04:23 -04:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2023-12-08 06:56:51 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
|
|
|
fetch-depth: 0
|
|
|
|
path: constellation
|
|
|
|
|
|
|
|
- name: Checkout terraform-provider-constellation repo
|
2024-05-24 05:04:23 -04:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2023-12-08 06:56:51 -05:00
|
|
|
with:
|
|
|
|
repository: edgelesssys/terraform-provider-constellation
|
|
|
|
ref: main
|
|
|
|
path: terraform-provider-constellation
|
|
|
|
token: ${{ !github.event.pull_request.head.repo.fork && secrets.CI_GITHUB_REPOSITORY || '' }}
|
|
|
|
|
|
|
|
- name: Update docs
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
rm -rf terraform-provider-constellation/docs
|
|
|
|
cp -r constellation/terraform-provider-constellation/docs terraform-provider-constellation/docs
|
|
|
|
|
|
|
|
- name: Create pull request
|
|
|
|
id: create-pull-request
|
2024-05-08 08:33:35 -04:00
|
|
|
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
|
2023-12-08 06:56:51 -05:00
|
|
|
with:
|
|
|
|
path: terraform-provider-constellation
|
|
|
|
branch: "feat/docs/update"
|
|
|
|
base: main
|
|
|
|
title: "Update provider documentation"
|
|
|
|
body: |
|
|
|
|
:robot: *This is an automated PR.* :robot:
|
|
|
|
|
|
|
|
This PR is triggered as part of the [Constellation CI](https://github.com/edgelesssys/constellation/actions/runs/${{ github.run_id }}).
|
|
|
|
It updates the documentation for Constellation's Terraform provider docs.
|
|
|
|
commit-message: "Update provider documentation"
|
|
|
|
committer: edgelessci <edgelessci@users.noreply.github.com>
|
|
|
|
# We need to push changes using a token, otherwise triggers like on:push and on:pull_request won't work.
|
|
|
|
token: ${{ !github.event.pull_request.head.repo.fork && secrets.CI_GITHUB_REPOSITORY || '' }}
|
|
|
|
delete-branch: true
|
|
|
|
|
|
|
|
- name: Merge pull request
|
2024-02-21 09:29:06 -05:00
|
|
|
uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0
|
2023-12-08 06:56:51 -05:00
|
|
|
with:
|
|
|
|
pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }}
|
|
|
|
merge-method: squash
|
|
|
|
repository: edgelesssys/terraform-provider-constellation
|
|
|
|
token: ${{ !github.event.pull_request.head.repo.fork && secrets.CI_GITHUB_REPOSITORY || '' }}
|