mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-18 18:18:23 -05:00
Improve workflow input handling (#34097)
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Waiting to run
Web App CI / check-types (push) Waiting to run
Web App CI / test (push) Waiting to run
Web App CI / build (push) Waiting to run
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Waiting to run
Web App CI / check-types (push) Waiting to run
Web App CI / test (push) Waiting to run
Web App CI / build (push) Waiting to run
* Improve workflow input handling by using environment variables with additional input validation and error handling
This commit is contained in:
parent
c597b4c70f
commit
5cefad29ee
1 changed files with 24 additions and 5 deletions
29
.github/workflows/tag-public-module.yaml
vendored
29
.github/workflows/tag-public-module.yaml
vendored
|
|
@ -22,6 +22,8 @@ jobs:
|
|||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
COMMIT_SHA: ${{ inputs.commit_sha }}
|
||||
steps:
|
||||
- name: release/checkout-mattermost
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
|
@ -32,14 +34,31 @@ jobs:
|
|||
run: |
|
||||
echo LATEST_MODULE_TAG=$(git tag --list 'server/public/*' --format='%(refname:lstrip=-1)' --sort -v:refname | head -1) >> ${GITHUB_ENV}
|
||||
|
||||
- name: release/validate-commit-sha
|
||||
run: |
|
||||
if [ -n "$COMMIT_SHA" ]; then
|
||||
# Validate commit SHA format (40 character hex string)
|
||||
if [[ ! "$COMMIT_SHA" =~ ^[a-f0-9]{40}$ ]]; then
|
||||
echo "Error: Invalid commit SHA format. Must be a 40-character hexadecimal string."
|
||||
exit 1
|
||||
fi
|
||||
# Verify the commit exists in the repository
|
||||
if ! git cat-file -e "$COMMIT_SHA" 2>/dev/null; then
|
||||
echo "Error: Commit SHA '$COMMIT_SHA' does not exist in the repository."
|
||||
exit 1
|
||||
fi
|
||||
echo "Commit SHA validation passed: $COMMIT_SHA"
|
||||
else
|
||||
echo "No commit SHA provided, will use HEAD"
|
||||
fi
|
||||
|
||||
- name: release/generate-module-release-notes
|
||||
run: |
|
||||
echo "RELEASE_NOTES<<EOF" >> ${GITHUB_ENV}
|
||||
if [ "${{ inputs.commit_sha }}" = "" ];
|
||||
then
|
||||
echo "$(git log --oneline --graph --decorate --abbrev-commit server/public/${{ env.LATEST_MODULE_TAG }}...$(git rev-parse HEAD) server/public)" >> ${GITHUB_ENV}
|
||||
else
|
||||
echo "$(git log --oneline --graph --decorate --abbrev-commit server/public/${{ env.LATEST_MODULE_TAG }}...${{ inputs.commit_sha }} server/public)" >> ${GITHUB_ENV}
|
||||
if [ -z "$COMMIT_SHA" ]; then
|
||||
echo "$(git log --oneline --graph --decorate --abbrev-commit server/public/${{ env.LATEST_MODULE_TAG }}...$(git rev-parse HEAD) server/public)" >> ${GITHUB_ENV}
|
||||
else
|
||||
echo "$(git log --oneline --graph --decorate --abbrev-commit server/public/${{ env.LATEST_MODULE_TAG }}...${COMMIT_SHA} server/public)" >> ${GITHUB_ENV}
|
||||
fi
|
||||
echo "EOF" >> ${GITHUB_ENV}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue