You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2024/01/12 09:08:12 UTC
(camel-k) 01/01: chore(ci): simplify nightly updates action
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch squakez-patch-1
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit a1958916a5d106d3a53f024217d97b261b7557d9
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Fri Jan 12 10:08:06 2024 +0100
chore(ci): simplify nightly updates action
---
.github/actions/automatic-updates/action.yml | 40 +++++++---------------------
1 file changed, 10 insertions(+), 30 deletions(-)
diff --git a/.github/actions/automatic-updates/action.yml b/.github/actions/automatic-updates/action.yml
index 04da33940..8abaf35d1 100644
--- a/.github/actions/automatic-updates/action.yml
+++ b/.github/actions/automatic-updates/action.yml
@@ -31,37 +31,24 @@ inputs:
runs:
using: "composite"
steps:
+
- name: Install Go ${{ inputs.goVersionFile }}
uses: actions/setup-go@v4
with:
go-version-file: ${{ inputs.goVersionFile }}
check-latest: true
+
- name: Generate changelog
uses: ./.github/actions/changelog
with:
token: ${{ inputs.secretGithubToken }}
release_branch: ${{ inputs.branch-ref }}
- # Changelog
- - name: Commit changelog
+ # Autogenerated resources
+ - name: Run project refresh actions
shell: bash
- env:
- CI_USER: "github-actions[bot]"
- CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
- run: |
- git config --local user.email "$CI_EMAIL"
- git config --local user.name "$CI_USER"
- git add CHANGELOG.md && git commit -m 'chore: changelog automatic update' && echo "changelog=1" >> $GITHUB_ENV || echo "No changes to changelog"
-
- # Autogenerated
- - name: Run refresh actions and commit
- shell: bash
- env:
- CI_USER: "github-actions[bot]"
- CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
run: |
make generate codegen update-docs
- git add -A && git commit -m 'chore: autogenerated project resource update' && echo "autogenerated=1" >> $GITHUB_ENV || echo "No changes to autogenerated project resources"
# Coverage badge
- name: Run Test
@@ -71,37 +58,30 @@ runs:
go tool cover -func=coverage.out -o=coverage.out
grep -o -P '(?<=\(statements\))(.+)(?=%)' coverage.out | xargs > coverage
touch badge.out
- - name: Go Coverage Badge
+ - name: Go coverage badge
uses: ./.github/actions/coverage-badge
with:
filename: coverage.out
target: badge.out
- - name: Convert Badge to adoc
+ - name: Convert badge to adoc
shell: bash
run: |
replacement=$(grep -o 'https://[^)]*' badge.out)
target="(?:https:\/\/img\.shields\.io\/badge\/Coverage).*?(?=\.svg)"
perl -i -pe "s|${target}|${replacement}|g" README.adoc
- - name: Commit changes
- shell: bash
- env:
- CI_USER: "github-actions[bot]"
- CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
- run: |
- git config --local user.email "$CI_EMAIL"
- git config --local user.name "$CI_USER"
- git add -A -f && git commit -m 'chore: nightly coverage changed' && echo "badge=1" >> $GITHUB_ENV || echo "No changes to coverage"
# Git push
- name: Push changes
shell: bash
- if: env.changelog == 1 || env.autogenerated == 1 || env.badge == 1
env:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
CI_TOKEN: ${{ inputs.secretGithubToken }}
run: |
- git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:${{ inputs.branch-ref }}
+ git config --local user.email "$CI_EMAIL"
+ git config --local user.name "$CI_USER"
+ git add -A -f && git commit -m 'chore: nightly automatic updates'
+ git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:${{ inputs.branch-ref }} || echo "No nightly automatic updates changes to push"
# Give it a rest to avoid hitting Github API rate limit
- name: Sleep