-
Notifications
You must be signed in to change notification settings - Fork 674
Initial (GHA) Workflow for creating the Porting Guide #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
1980cd4
Adds intial workflow for Porting Guide PR
anweshadas a363078
Fixes the directory for the ansible documentation checkout
anweshadas 202fbcc
Fixes the directory for the new branch
anweshadas bd4c91c
Fixes the EOF error with qouting
anweshadas d247a52
Add steps to check what is there inside a directory
anweshadas a95a728
Edits the tar command
anweshadas dff68af
Fixes ansible versioning for Porting Guide
anweshadas ce1f9fe
Fixes tar command for debuging
anweshadas 7d67396
Fixes directory for PR
anweshadas 9bd4c23
Fixes the names of the steps
anweshadas deb3531
Updates to the correct barnch
anweshadas 57f47ad
Fixes changes based on the review feedback
anweshadas 7ac05fb
Cleans git and github steps for better security
anweshadas e97b436
Edits to get Porting guide from ansible-build-data git repo
anweshadas e3b7fb2
Checks out correct repo
anweshadas fbab373
Edits to retrive major version from user input
anweshadas bb9ea84
Removes redundant quote from PR text
anweshadas 39271bf
Reformts abd general cleanup
anweshadas e452fcb
Edits to working-directory
anweshadas e50cb2c
Updates based on feedback
anweshadas 2ce8b1a
Update .github/workflows/docsbuild-release.yaml
anweshadas 6dedaf3
release porting guide workflow
oraNod e9eb9f3
use a reusable workflow
oraNod 63bb7a8
use plain git cmds instead of gha
oraNod e17ffdb
More updates based on review feedback
anweshadas 5604b9a
Updates based on latest review feedback
anweshadas 2c52837
Update .github/workflows/reusable-porting-guide.yml
anweshadas 287d93f
Update .github/workflows/reusable-porting-guide.yml
anweshadas 2d4bc2e
Update .github/workflows/reusable-porting-guide.yml
anweshadas 4663368
Update .github/workflows/reusable-porting-guide.yml
anweshadas c859aba
Update .github/workflows/release-porting-guide.yml
anweshadas 5dd2143
Update .github/workflows/release-porting-guide.yml
anweshadas 4b85023
Uses single workflow file
anweshadas 0802592
Update .github/workflows/release-porting-guide.yml
anweshadas e10dd31
Update .github/workflows/release-porting-guide.yml
anweshadas 73aa036
Update .github/workflows/release-porting-guide.yml
anweshadas 39d9909
Creates draft PR
anweshadas e43ac6a
Updates workflow to comment on the new PR
anweshadas 1aa44a0
Creates PR against devel branch
anweshadas f9cb244
Adds ready_for_review PR type to pull_request event
anweshadas b75dde8
Updates based on (Felix's) feedback
anweshadas 0dfe040
Update .github/workflows/ci.yaml
anweshadas ef97cf8
Update .github/workflows/release-porting-guide.yml
anweshadas d16815e
Update .github/workflows/release-porting-guide.yml
anweshadas 63842c7
Update .github/workflows/release-porting-guide.yml
anweshadas a6b9539
Update .github/workflows/release-porting-guide.yml
anweshadas 5574ba8
Update .github/workflows/release-porting-guide.yml
anweshadas 547c1ab
Update .github/workflows/release-porting-guide.yml
anweshadas f2132d9
Adds types to pull_request_target
anweshadas d037e94
Removes unused identifier from the workflow step
anweshadas 931af69
Updates all missing env variables
anweshadas 59e0300
Update .github/workflows/release-porting-guide.yml
anweshadas a30afab
Update .github/workflows/release-porting-guide.yml
anweshadas cdce575
Update .github/workflows/release-porting-guide.yml
anweshadas fcef4c8
Updates ANSIBLE_VERSION_MAJOR env variable creation
anweshadas 23f6b28
Update .github/workflows/release-porting-guide.yml
anweshadas f6058b7
Removes id
anweshadas 2d6c9c9
Update .github/workflows/release-porting-guide.yml
anweshadas fc40546
Update .github/workflows/release-porting-guide.yml
anweshadas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`) | ||
felixfontein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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}" | ||
felixfontein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 }} | ||
anweshadas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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}" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.