Skip to content

Commit

Permalink
Update GHA release logic (syntax) (#295)
Browse files Browse the repository at this point in the history
* Update GHA release logic (syntax)

* Temporarily enable diagnostics

* Temporarily enable diagnostics

* Temporarily enable diagnostics

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* x

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* y

* z

* z

* z

* z

* z

* z

* z

* z

* z

* z

* Move prt to glci pipeline
  • Loading branch information
op-ct authored May 3, 2023
1 parent 83e0af7 commit 34cf500
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/pr_glci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
# The secure vars will be filtered in GitHub Actions log output, and aren't
# provided to untrusted builds (i.e, triggered by PR from another repository)
#
#
# GitHub Action Variables available for this pipeline:
#
# GitHub variable Notes
# ------------------------------ ----------------------------------------
# GITLAB_API_CI_LINT_PROJECT_URL API url up to .../projects/:id
# if omitted, tries to use the identical
# org/project on gitlab.com
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!V!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down Expand Up @@ -58,7 +67,6 @@ on:
types: [opened, reopened, synchronize]

jobs:

# The ONLY reason we can validate the PR HEAD's content safely here is that
# we restrict ourselves to sending data elsewhere.
glci-syntax:
Expand All @@ -68,15 +76,20 @@ jobs:
valid: ${{ steps.validate-glci-file.outputs.valid }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Validate required secrets and vars
env:
_API: ${{ vars.GITLAB_API_CI_LINT_PROJECT_URL }}
_TOK: ${{ secrets.GITLAB_API_PRIVATE_TOKEN }}
run: |
[[ -n $_API ]] || echo '::warning ::vars.GITLAB_API_CI_LINT_PROJECT_URL is empty!'
[[ -n $_TOK ]] || echo '::error ::secrets.GITLAB_API_PRIVATE_TOKEN is empty!'
[[ -n $_TOK ]]
- name: 'Validate GLCI file syntax'
id: validate-glci-file
uses: simp/github-action-gitlab-ci-syntax-check@main
uses: simp/github-action-gitlab-ci-syntax-check@tests/fix-gitlab-api
with:
gitlab_api_private_token: ${{ secrets.GITLAB_API_PRIVATE_TOKEN }}
gitlab_api_url: ${{ secrets.GITLAB_API_URL }} # https://gitlab.com/api/v4
gitlab_api_url: ${{ vars.GITLAB_API_CI_LINT_PROJECT_URL || format('https://gitlab.com/api/v4/projects/{0}%2F{1}', github.event.organization.login, github.event.repository.name) }}

contributor-permissions:
name: 'PR contributor check'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
types: [opened, reopened, synchronize]

env:
PUPPET_VERSION: '~> 6'
PUPPET_VERSION: '~> 7'

jobs:
puppet-syntax:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tag_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ jobs:
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IS_PRERELASE: ${{ steps.tag-check.outputs.prerelease }}
run: |
echo "${RELEASE_MESSAGE}" > /tmp/.commit-msg.txt
args=(--file /tmp/.commit-msg.txt)
[[ ${{ steps.tag-check.outputs.prerelease }} == yes ]] && args+=(--prerelease)
[[ $IS_PRERELASE == yes ]] && args+=(--prerelease)
hub release create ${args[@]} "$TARGET_TAG"
Expand Down

0 comments on commit 34cf500

Please sign in to comment.