mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-26 13:18:58 +07:00
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2 to 3. - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Commits](https://github.com/actions/create-github-app-token/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/create-github-app-token dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
98 lines
3.2 KiB
YAML
98 lines
3.2 KiB
YAML
---
|
|
name: Ansible porting guide creation
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ansible-build-data-branch:
|
|
description: >-
|
|
Release Branch name from the Ansible Build data PR.
|
|
(e.g. `refs/pull/1/merge`)
|
|
required: true
|
|
ansible-version:
|
|
description: >-
|
|
Exact release version. For example, 12.1.0
|
|
required: true
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
upload-porting-guide:
|
|
name: Extract the porting guide
|
|
runs-on: ubuntu-latest
|
|
environment: github-bot
|
|
env:
|
|
GIT_BRANCH: "release/porting-guide-${{ inputs.ansible-version }}"
|
|
ANSIBLE_VERSION_FULL: ${{ inputs.ansible-version }}
|
|
CI_COMMIT_MESSAGE: >-
|
|
Add the Ansible community ${{ inputs.ansible-version }} porting guide
|
|
|
|
steps:
|
|
- name: Extract the major version
|
|
run: echo "ANSIBLE_VERSION_MAJOR=${ANSIBLE_VERSION_FULL%%.*}" >> "${GITHUB_ENV}"
|
|
shell: bash --noprofile --norc -O extglob -eEuo pipefail {0}
|
|
|
|
- name: Generate temp GITHUB_TOKEN
|
|
id: create_token
|
|
uses: actions/create-github-app-token@v3
|
|
with:
|
|
app-id: ${{ secrets.BOT_APP_ID }} # From github-bot environment
|
|
private-key: ${{ secrets.BOT_APP_KEY }} # From github-bot environment
|
|
|
|
- name: Check out this repo src
|
|
uses: actions/checkout@v6
|
|
with:
|
|
token: ${{ steps.create_token.outputs.token }}
|
|
persist-credentials: true # Needed to push to the repo
|
|
|
|
- name: Check out ansible-build-data
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: ansible-community/ansible-build-data
|
|
ref: ${{ inputs.ansible-build-data-branch }}
|
|
path: ansible-build-data
|
|
persist-credentials: false
|
|
|
|
- name: Copy the RST file to the correct path
|
|
run: >-
|
|
cp -v
|
|
"ansible-build-data/${ANSIBLE_VERSION_MAJOR}/porting_guide_${ANSIBLE_VERSION_MAJOR}.rst"
|
|
docs/docsite/rst/porting_guides/
|
|
|
|
- name: Set up git
|
|
run: |
|
|
git switch --create "${GIT_BRANCH}"
|
|
ACTOR_NAME="$(curl -s https://api.github.com/users/"${GITHUB_ACTOR}" | jq --raw-output '.name // .login')"
|
|
git config --global user.name "${ACTOR_NAME}"
|
|
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
|
|
|
|
- name: Add the porting guide
|
|
run: git add docs/docsite/rst/porting_guides/"porting_guide_${ANSIBLE_VERSION_MAJOR}.rst"
|
|
|
|
- name: Commit the porting guide
|
|
run: >-
|
|
git diff-index --quiet HEAD ||
|
|
git commit -m "${CI_COMMIT_MESSAGE}"
|
|
|
|
- name: Push to the repo
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
|
|
run: git push origin "${GIT_BRANCH}"
|
|
|
|
- name: Create the porting guide PR
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
|
|
PR_BODY_MESSAGE: |-
|
|
##### ISSUE TYPE
|
|
|
|
- Docs Pull Request
|
|
|
|
##### COMPONENT NAME
|
|
|
|
docs/docsite/rst/porting_guides/porting_guide_${{ env.ANSIBLE_VERSION_MAJOR }}.rst
|
|
run: >-
|
|
gh pr create
|
|
--base devel
|
|
--head "${GIT_BRANCH}"
|
|
--title "${CI_COMMIT_MESSAGE}"
|
|
--body "${PR_BODY_MESSAGE}"
|