fix(deps): update module sigs.k8s.io/controller-runtime to v0.16.2 (#… #183
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
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: ^1.18 | |
- 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 [email protected] | |
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 "" |