Skip to content
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

feat: Add new techdocs-rewrite-relative-links-action #99

Merged
merged 30 commits into from
May 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
106685f
feat: Add new techdocs-rewrite-relative-links-action
zerok Apr 18, 2024
e3d8a0c
WIP: Load docs dir from mkdocs.yml file
zerok Apr 18, 2024
943d147
Hook action into publish-techdocs workflow
zerok Apr 18, 2024
0bf9af7
Disable publishing in order to do testruns
zerok Apr 18, 2024
b1bb1e5
s/input/inputs/g
zerok Apr 18, 2024
7cff158
Fix action branch
zerok Apr 18, 2024
0c04653
Fix action name
zerok Apr 18, 2024
b1e434a
Fix go run call
zerok Apr 18, 2024
2297e2b
Use action_ref to link workflow and action
zerok Apr 18, 2024
fc88891
Uses does not support expressions, undoing previous commit
zerok Apr 18, 2024
0d523a9
Show diff of changes for review
zerok Apr 18, 2024
3de6815
Add more tests
zerok Apr 18, 2024
75a32dd
Use local action
zerok Apr 18, 2024
e791ab2
Use workflow-ref
zerok Apr 18, 2024
356f82d
Fallback for pull requests
zerok Apr 18, 2024
ae6fb69
Falling back to non-relative action (lower complexity)
zerok Apr 18, 2024
127985b
Cleanup + verbose input flag
zerok Apr 19, 2024
b82f300
Use slogt for test logging
zerok Apr 22, 2024
8c73cff
Use signal.NotifyContext for the root context
zerok Apr 22, 2024
fc49f8b
Table tests
zerok Apr 22, 2024
ee9997f
Use actionslog inside GHA context
zerok Apr 22, 2024
3d85db7
Return early
zerok Apr 22, 2024
c463927
Add dry-run mode that only prints a diff
zerok Apr 23, 2024
60fd390
Enable local actions through customizable checkout path
zerok Apr 29, 2024
ef5c8a8
Move fs interactions to afero for better mocking
zerok Apr 29, 2024
37f5f15
Add documentation
zerok Apr 29, 2024
812dbef
Explicitly use Go 1.22.2
zerok Apr 29, 2024
dfa05b6
Rename skip-checkout to checkout
zerok May 2, 2024
4fa4dc8
Fix linting issues
zerok May 2, 2024
f68dffd
Prepare for merge
zerok May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fallback for pull requests
  • Loading branch information
zerok committed May 2, 2024
commit 356f82d86418c18a1f5a275ac581b0fb8dd692c9
11 changes: 9 additions & 2 deletions .github/workflows/publish-techdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,25 @@ jobs:
if: inputs.checkout-repo

- id: workflow-ref
name: Determine workflow ref
if: inputs.rewrite-relative-links
shell: bash
run: |
echo "${{ github.workflow_ref }}" | awk '{split($0,a,"@");printf "workflow_ref=%s",a[2]}' >> $GITHUB_OUTPUT
ref=$(echo "${{ github.workflow_ref }}" | awk '{split($0,a,"@");printf "%s",a[2]}')
# pull request refs cannot be checked out, so we need to fall back:
if [[ "${ref}" =~ ^refs/pull/ ]]; then
printf "ref=zerok/techdocs-rewrite-relative-links-action" >> $GITHUB_OUTPUT
else
printf "ref=%s" $ref >> $GITHUB_OUTPUT
fi

- id: checkout-shared-workflows
if: inputs.rewrite-relative-links
name: Checkout shared workflows
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: grafana/shared-workflows
ref: ${{ steps.workflow-ref.outputs.workflow_ref }}
ref: ${{ steps.workflow-ref.outputs.ref }}
path: _shared-workflows

- name: Rewrite relative links
Expand Down