Skip to content

add docker desktop (#301) #202

add docker desktop (#301)

add docker desktop (#301) #202

name: update-readme
on:
schedule:
- cron: '0 0 * * MON'
push:
branches:
- main
env:
BRANCH_NAME: update-date-in-readme
BASE_BRANCH_NAME: main
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
create-pr-if-outdated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
ref: ${{ env.BASE_BRANCH_NAME }}
- name: update versions in readme.yml
run: |
argocd_version=$(yq '.bases[0]' contents/argocd/setup/kustomization.yaml | sed 's/.*?ref=\(.*\)/\1/')
yq -i "(.versions[] | select(.name == \"ArgoCD\").version) = \"$argocd_version\"" readme.yml
- name: set up
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: update readme
run: go run readme.go
- name: check if need to commit
id: need_commit
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "::set-output name=need_commit::true
else
echo "::set-output name=need_commit::false
fi
- name: update date in readme and commit
if: steps.need_commit.outputs.need_commit == 'true'
id: commit
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git checkout -b ${{ env.BRANCH_NAME }}
git add .
git commit -m 'update readme'
git push -u origin HEAD -f # nothing to commit
- name: check if pr exists
if: steps.need_commit.outputs.need_commit == 'true'
id: check_pr
run: |
echo "::set-output name=count::$(gh pr list -S head:${{ env.BRANCH_NAME }} -B ${{ env.BASE_BRANCH_NAME }} | wc -l)"
- name: create pr
if: ${{ steps.need_commit.outputs.need_commit == 'true' && steps.check_pr.outputs.count == 0 }}
run: |
gh pr create -B "${{ env.BASE_BRANCH_NAME }}" -t "Update version in README" -b ""