-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
- Loading branch information
1 parent
5f1ef34
commit 3d065e7
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
.github/workflows/azure-static-web-apps-white-bush-0475e2d03.yml
This file contains 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,49 @@ | ||
name: Update README with Latest Docs Build | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-readme: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout current repository | ||
uses: actions/checkout@v2 | ||
|
||
# - name: Clone headlamp repository | ||
# run: | | ||
# git clone https://github.com/headlamp-k8s/headlamp.git | ||
# cd headlamp | ||
# LATEST_COMMIT=$(git log -n 1 --pretty=format:"%H" -- docs) | ||
# echo "::set-output name=commit::$LATEST_COMMIT" | ||
|
||
# - name: Authenticate GitHub CLI | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# run: | | ||
# echo $GITHUB_TOKEN | gh auth login --with-token | ||
|
||
- name: Get latest commit hash from docs folder in headlamp repo | ||
run: | | ||
export LATEST_COMMIT=$(gh api repos/headlamp-k8s/headlamp/commits --jq '.[0].sha' -F path=docs) | ||
echo "LATEST_COMMIT=$LATEST_COMMIT" >> $GITHUB_ENV | ||
- name: Update README.md | ||
run: | | ||
README_FILE="README.md" | ||
DOCS_LINK="https://github.com/headlamp-k8s/headlamp/tree/$LATEST_COMMIT/docs" | ||
sed -i "s|^Latest docs build: \[.*\]|Latest docs build: \[$LATEST_COMMIT\]($DOCS_LINK)|" $README_FILE | ||
env: | ||
LATEST_COMMIT: ${{ env.LATEST_COMMIT }} | ||
|
||
- name: Commit and push changes | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add README.md | ||
git checkout -b update-readme | ||
git commit -m "README: Update with latest docs build (automated commit)" | ||
git push origin update-readme | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |