Skip to content

Commit

Permalink
chore(ci): make relative urls absolute in docker hub readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtwnklr committed Feb 24, 2023
1 parent 4a700c6 commit c5e4b5c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ on:
env:
SHORT_DESCRIPTION: A gateway that transforms and forwards HTTP POST notification payloads to an Apprise API server.

README_RELATIVE_LINK_PATTERN: (\[[^]]+\]\()(\#[^)]+\))
README_ABSOLUTE_LINK_PREFIX: https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}

RAW_RELATIVE_LINK_PATTERN: (\[[^]]+\]\()([^:)]+[.](gif|jpeg|jpeg|png|svg)\))
RAW_ABSOLUTE_LINK_PREFIX: https://github.com/${{ github.repository }}/raw/${{ github.ref_name }}/

BLOB_RELATIVE_LINK_PATTERN: (\[[^]]+\]\()([^:)]+\))
BLOB_ABSOLUTE_LINK_PREFIX: https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/

jobs:
dockerHubDescription:
name: Publish README to Docker Hub
Expand All @@ -21,6 +30,12 @@ jobs:
- name: Check out the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c

- name: Make relative urls absolute
run: |
sed -i -E 's#${{ env.README_RELATIVE_LINK_PATTERN }}#\1${{ env.README_ABSOLUTE_LINK_PREFIX }}\2#g' README.md
sed -i -E 's#${{ env.RAW_RELATIVE_LINK_PATTERN }}#\1${{ env.RAW_ABSOLUTE_LINK_PREFIX }}\2#g' README.md
sed -i -E 's#${{ env.BLOB_RELATIVE_LINK_PATTERN }}#\1${{ env.BLOB_ABSOLUTE_LINK_PREFIX }}\2#g' README.md
- name: Publish README
uses: peter-evans/dockerhub-description@067627a8af8c4a66c03b5b5e896968ca4cafba79
with:
Expand Down

0 comments on commit c5e4b5c

Please sign in to comment.