chore(deps): bump peter-evans/create-pull-request from 7.0.5 to 7.0.6… #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2023 Comcast Cable Communications Management, LLC | |
# SPDX-License-Identifier: Apache-2.0 | |
name: "Update docs" | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '.github/workflows/*.yml' | |
workflow_dispatch: | |
jobs: | |
document: | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: [ ubuntu-latest ] | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Generate Usage Documentation | |
id: documenter | |
uses: gizumon/github-actions-documenter@843a0f92e66b5db20f76d3c707beb0329b48c628 # v0.2.2 | |
with: | |
should-skip-generate-agenda: false | |
- name: Update the file | |
env: | |
DOCUMENT: ${{ steps.documenter.outputs.output }} | |
shell: bash | |
run: | | |
prefix='.shared_workflow_documenter' | |
start_line=$(grep -n "<!--\s*@overwrite-anchor=start\s*-->" README.md | grep -oh "^[0-9]*") | |
end_line=$(grep -n "<!--\s*@overwrite-anchor=end\s*-->" README.md | grep -oh "^[0-9]*") | |
# Ensure empty files are there. | |
touch ${prefix}_start.tmp | |
touch ${prefix}_end.tmp | |
# store the part before if start | |
if [ -n "${start_line}" ]; then | |
sed -e "$((${start_line})),\$d" README.md > ${prefix}_start.tmp | |
fi | |
# store the part after if end | |
if [ -n "${end_line}" ]; then | |
sed -e "1,$((${end_line}))d" README.md > ${prefix}_end.tmp | |
fi | |
cat ${prefix}_start.tmp > README.md | |
echo "${DOCUMENT}" >> README.md | |
cat ${prefix}_end.tmp >> README.md | |
rm ${prefix}_start.tmp | |
rm ${prefix}_end.tmp | |
- name: Create Pull Request | |
if: | | |
inputs.dry-run == false | |
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 | |
with: | |
title: ignore:Update Workflow Documentation | |
body: | | |
Update the github action workflow documentation. | |
branch: update-workflow-documentation | |
token: ${{ github.token }} | |
delete-branch: true |