mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-26 13:18:58 +07:00
Initial (GHA) Workflow for creating the Porting Guide (#121)
* Adds intial workflow for Porting Guide PR * Fixes the directory for the ansible documentation checkout * Fixes the directory for the new branch * Fixes the EOF error with qouting * Add steps to check what is there inside a directory * Edits the tar command * Fixes ansible versioning for Porting Guide * Fixes tar command for debuging * Fixes directory for PR * Fixes the names of the steps * Updates to the correct barnch * Fixes changes based on the review feedback Fixes changes based on the review feedback Updates based on the feedback * Cleans git and github steps for better security Provides secrets only in the necessary steps. Uses `--body-file` to `gh pr` command. * Edits to get Porting guide from ansible-build-data git repo * Checks out correct repo * Edits to retrive major version from user input * Removes redundant quote from PR text * Reformts abd general cleanup * Edits to working-directory * Updates based on feedback * Update .github/workflows/docsbuild-release.yaml Co-authored-by: Don Naro <dnaro@redhat.com> * release porting guide workflow * use a reusable workflow * use plain git cmds instead of gha * More updates based on review feedback * Updates based on latest review feedback * Update .github/workflows/reusable-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/reusable-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/reusable-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/reusable-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Uses single workflow file Fetching porting guide from the ansible-build-data repo from the release PR branch. Creating Porting Guide PR using rst file. * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Creates draft PR * Updates workflow to comment on the new PR * Creates PR against devel branch * Adds ready_for_review PR type to pull_request event * Updates based on (Felix's) feedback Making the comment about the draft PR on the PR's body itself. * Update .github/workflows/ci.yaml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Adds types to pull_request_target * Removes unused identifier from the workflow step * Updates all missing env variables Removes extra step, fixes typo and ANSIBLE-VERSION-MAJOR calculation in Bash. * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Update .github/workflows/release-porting-guide.yml Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> * Updates ANSIBLE_VERSION_MAJOR env variable creation * Update .github/workflows/release-porting-guide.yml Co-authored-by: Don Naro <dnaro@redhat.com> * Removes id * Update .github/workflows/release-porting-guide.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update .github/workflows/release-porting-guide.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Don Naro <dnaro@redhat.com> Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
5
.github/workflows/ci.yaml
vendored
5
.github/workflows/ci.yaml
vendored
@@ -9,6 +9,11 @@ name: Ansible Docsite CI
|
||||
- 'patchback/**'
|
||||
- 'pip-compile/**'
|
||||
pull_request:
|
||||
types:
|
||||
- opened # default
|
||||
- synchronize # default
|
||||
- reopened # default
|
||||
- ready_for_review # used in PRs created from GitHub Actions workflows
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
5
.github/workflows/labeler.yml
vendored
5
.github/workflows/labeler.yml
vendored
@@ -4,6 +4,11 @@
|
||||
|
||||
"on":
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened # default
|
||||
- synchronize # default
|
||||
- reopened # default
|
||||
- ready_for_review # used in PRs created from GitHub Actions workflows
|
||||
branches:
|
||||
- devel
|
||||
- "stable-*"
|
||||
|
||||
85
.github/workflows/release-porting-guide.yml
vendored
Normal file
85
.github/workflows/release-porting-guide.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
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
|
||||
|
||||
jobs:
|
||||
upload-porting-guide:
|
||||
name: Extract the porting guide
|
||||
runs-on: ubuntu-latest
|
||||
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: Check out this repo src
|
||||
uses: actions/checkout@v4
|
||||
- name: Check out ansible-build-data
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ansible-community/ansible-build-data
|
||||
ref: ${{ inputs.ansible-build-data-branch }}
|
||||
path: ansible-build-data
|
||||
|
||||
- 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
|
||||
run: git push origin "${GIT_BRANCH}"
|
||||
|
||||
- name: Create the porting guide PR as draft
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
PR_BODY_MESSAGE: |-
|
||||
##### SUMMARY
|
||||
|
||||
This is a draft PR. Please mark the PR as ready for review to trigger PR checks.
|
||||
|
||||
##### ISSUE TYPE
|
||||
|
||||
- Docs Pull Request
|
||||
|
||||
##### COMPONENT NAME
|
||||
|
||||
docs/docsite/rst/porting_guides/porting_guide_${{ env.ANSIBLE_VERSION_MAJOR }}.rst
|
||||
run: >-
|
||||
gh pr create
|
||||
--draft
|
||||
--base devel
|
||||
--head "${GIT_BRANCH}"
|
||||
--title "${CI_COMMIT_MESSAGE}"
|
||||
--body "${PR_BODY_MESSAGE}"
|
||||
Reference in New Issue
Block a user