fix: pin 2 unpinned action(s),extract 21 unsafe expression(s) to env vars (#38893)

This commit is contained in:
dagecko
2026-03-27 03:38:20 -04:00
committed by GitHub
parent 8cbf5fb8df
commit 8700ec4e6d
10 changed files with 59 additions and 27 deletions

View File

@@ -51,27 +51,31 @@ jobs:
- name: supersetbot bump-python -p "${{ github.event.inputs.package }}" - name: supersetbot bump-python -p "${{ github.event.inputs.package }}"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_PACKAGE: ${{ github.event.inputs.package }}
INPUT_GROUP: ${{ github.event.inputs.group }}
INPUT_EXTRA_FLAGS: ${{ github.event.inputs.extra-flags }}
INPUT_LIMIT: ${{ github.event.inputs.limit }}
run: | run: |
git config --global user.email "action@github.com" git config --global user.email "action@github.com"
git config --global user.name "GitHub Action" git config --global user.name "GitHub Action"
PACKAGE_OPT="" PACKAGE_OPT=""
if [ -n "${{ github.event.inputs.package }}" ]; then if [ -n "${INPUT_PACKAGE}" ]; then
PACKAGE_OPT="-p ${{ github.event.inputs.package }}" PACKAGE_OPT="-p ${INPUT_PACKAGE}"
fi fi
GROUP_OPT="" GROUP_OPT=""
if [ -n "${{ github.event.inputs.group }}" ]; then if [ -n "${INPUT_GROUP}" ]; then
GROUP_OPT="-g ${{ github.event.inputs.group }}" GROUP_OPT="-g ${INPUT_GROUP}"
fi fi
EXTRA_FLAGS="${{ github.event.inputs.extra-flags }}" EXTRA_FLAGS="${INPUT_EXTRA_FLAGS}"
supersetbot bump-python \ supersetbot bump-python \
--verbose \ --verbose \
--use-current-repo \ --use-current-repo \
--include-subpackages \ --include-subpackages \
--limit ${{ github.event.inputs.limit }} \ --limit ${INPUT_LIMIT} \
$PACKAGE_OPT \ $PACKAGE_OPT \
$GROUP_OPT \ $GROUP_OPT \
$EXTRA_FLAGS $EXTRA_FLAGS

View File

@@ -16,10 +16,12 @@ jobs:
id: check id: check
shell: bash shell: bash
run: | run: |
if [ -n "${{ (secrets.NPM_TOKEN != '') || '' }}" ]; then if [ -n "${NPM_TOKEN}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT" echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi fi
env:
NPM_TOKEN: ${{ (secrets.NPM_TOKEN != '') || '' }}
build: build:
needs: config needs: config
if: needs.config.outputs.has-secrets if: needs.config.outputs.has-secrets

View File

@@ -20,10 +20,12 @@ jobs:
id: check id: check
shell: bash shell: bash
run: | run: |
if [ -n "${{ (secrets.AWS_ACCESS_KEY_ID != '' && secrets.AWS_SECRET_ACCESS_KEY != '') || '' }}" ]; then if [ -n "${AWS_ACCESS_KEY_ID}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT" echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi fi
env:
AWS_ACCESS_KEY_ID: ${{ (secrets.AWS_ACCESS_KEY_ID != '' && secrets.AWS_SECRET_ACCESS_KEY != '') || '' }}
ephemeral-env-cleanup: ephemeral-env-cleanup:
needs: config needs: config
if: needs.config.outputs.has-secrets if: needs.config.outputs.has-secrets
@@ -33,7 +35,7 @@ jobs:
pull-requests: write pull-requests: write
steps: steps:
- name: Configure AWS credentials - name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6 uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6
with: with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -56,7 +58,7 @@ jobs:
- name: Login to Amazon ECR - name: Login to Amazon ECR
if: steps.describe-services.outputs.active == 'true' if: steps.describe-services.outputs.active == 'true'
id: login-ecr id: login-ecr
uses: aws-actions/amazon-ecr-login@v2 uses: aws-actions/amazon-ecr-login@183a1442edf41672e66566b7fc560e297a290896 # v2
- name: Delete ECR image tag - name: Delete ECR image tag
if: steps.describe-services.outputs.active == 'true' if: steps.describe-services.outputs.active == 'true'

View File

@@ -47,7 +47,7 @@ jobs:
id: eval-label id: eval-label
run: | run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
LABEL_NAME="${{ github.event.inputs.label_name }}" LABEL_NAME="${INPUT_LABEL_NAME}"
else else
LABEL_NAME="${{ github.event.label.name }}" LABEL_NAME="${{ github.event.label.name }}"
fi fi
@@ -60,6 +60,8 @@ jobs:
echo "result=noop" >> $GITHUB_OUTPUT echo "result=noop" >> $GITHUB_OUTPUT
fi fi
env:
INPUT_LABEL_NAME: ${{ github.event.inputs.label_name }}
- name: Get event SHA - name: Get event SHA
id: get-sha id: get-sha
if: steps.eval-label.outputs.result == 'up' if: steps.eval-label.outputs.result == 'up'
@@ -276,7 +278,9 @@ jobs:
- name: Describe ECS service - name: Describe ECS service
id: describe-services id: describe-services
run: | run: |
echo "active=$(aws ecs describe-services --cluster superset-ci --services pr-${{ github.event.inputs.issue_number || github.event.pull_request.number }}-service | jq '.services[] | select(.status == "ACTIVE") | any')" >> $GITHUB_OUTPUT echo "active=$(aws ecs describe-services --cluster superset-ci --services pr-${INPUT_ISSUE_NUMBER}-service | jq '.services[] | select(.status == "ACTIVE") | any')" >> $GITHUB_OUTPUT
env:
INPUT_ISSUE_NUMBER: ${{ github.event.inputs.issue_number || github.event.pull_request.number }}
- name: Create ECS service - name: Create ECS service
id: create-service id: create-service
if: steps.describe-services.outputs.active != 'true' if: steps.describe-services.outputs.active != 'true'
@@ -307,7 +311,9 @@ jobs:
- name: List tasks - name: List tasks
id: list-tasks id: list-tasks
run: | run: |
echo "task=$(aws ecs list-tasks --cluster superset-ci --service-name pr-${{ github.event.inputs.issue_number || github.event.pull_request.number }}-service | jq '.taskArns | first')" >> $GITHUB_OUTPUT echo "task=$(aws ecs list-tasks --cluster superset-ci --service-name pr-${INPUT_ISSUE_NUMBER}-service | jq '.taskArns | first')" >> $GITHUB_OUTPUT
env:
INPUT_ISSUE_NUMBER: ${{ github.event.inputs.issue_number || github.event.pull_request.number }}
- name: Get network interface - name: Get network interface
id: get-eni id: get-eni
run: | run: |

View File

@@ -16,10 +16,12 @@ jobs:
id: check id: check
shell: bash shell: bash
run: | run: |
if [ -n "${{ (secrets.FOSSA_API_KEY != '' ) || '' }}" ]; then if [ -n "${FOSSA_API_KEY}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT" echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi fi
env:
FOSSA_API_KEY: ${{ (secrets.FOSSA_API_KEY != '' ) || '' }}
license_check: license_check:
needs: config needs: config
if: needs.config.outputs.has-secrets if: needs.config.outputs.has-secrets

View File

@@ -16,10 +16,12 @@ jobs:
id: check id: check
shell: bash shell: bash
run: | run: |
if [ -n "${{ (secrets.NPM_TOKEN != '' && secrets.GH_PERSONAL_ACCESS_TOKEN != '') || '' }}" ]; then if [ -n "${NPM_TOKEN}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT" echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi fi
env:
NPM_TOKEN: ${{ (secrets.NPM_TOKEN != '' && secrets.GH_PERSONAL_ACCESS_TOKEN != '') || '' }}
build: build:
needs: config needs: config
if: needs.config.outputs.has-secrets if: needs.config.outputs.has-secrets

View File

@@ -102,10 +102,12 @@ jobs:
- name: Install Superset Showtime - name: Install Superset Showtime
if: steps.auth.outputs.authorized == 'true' if: steps.auth.outputs.authorized == 'true'
run: | run: |
echo "::notice::Maintainer ${{ github.actor }} triggered deploy for PR ${{ github.event.pull_request.number || github.event.inputs.pr_number }}" echo "::notice::Maintainer ${{ github.actor }} triggered deploy for PR ${PULL_REQUEST_NUMBER}"
pip install --upgrade superset-showtime pip install --upgrade superset-showtime
showtime version showtime version
env:
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
- name: Check what actions are needed - name: Check what actions are needed
if: steps.auth.outputs.authorized == 'true' if: steps.auth.outputs.authorized == 'true'
id: check id: check
@@ -113,12 +115,14 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_PR_NUMBER: ${{ github.event.inputs.pr_number }}
INPUT_SHA: ${{ github.event.inputs.sha }}
run: | run: |
# Bulletproof PR number extraction # Bulletproof PR number extraction
if [[ -n "${{ github.event.pull_request.number }}" ]]; then if [[ -n "${{ github.event.pull_request.number }}" ]]; then
PR_NUM="${{ github.event.pull_request.number }}" PR_NUM="${{ github.event.pull_request.number }}"
elif [[ -n "${{ github.event.inputs.pr_number }}" ]]; then elif [[ -n "${INPUT_PR_NUMBER}" ]]; then
PR_NUM="${{ github.event.inputs.pr_number }}" PR_NUM="${INPUT_PR_NUMBER}"
else else
echo "❌ No PR number found in event or inputs" echo "❌ No PR number found in event or inputs"
exit 1 exit 1
@@ -127,8 +131,8 @@ jobs:
echo "Using PR number: $PR_NUM" echo "Using PR number: $PR_NUM"
# Run sync check-only with optional SHA override # Run sync check-only with optional SHA override
if [[ -n "${{ github.event.inputs.sha }}" ]]; then if [[ -n "${INPUT_SHA}" ]]; then
OUTPUT=$(python -m showtime sync $PR_NUM --check-only --sha "${{ github.event.inputs.sha }}") OUTPUT=$(python -m showtime sync $PR_NUM --check-only --sha "${INPUT_SHA}")
else else
OUTPUT=$(python -m showtime sync $PR_NUM --check-only) OUTPUT=$(python -m showtime sync $PR_NUM --check-only)
fi fi

View File

@@ -27,10 +27,12 @@ jobs:
id: check id: check
shell: bash shell: bash
run: | run: |
if [ -n "${{ (secrets.SUPERSET_SITE_BUILD != '' && secrets.SUPERSET_SITE_BUILD != '') || '' }}" ]; then if [ -n "${SUPERSET_SITE_BUILD}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT" echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi fi
env:
SUPERSET_SITE_BUILD: ${{ (secrets.SUPERSET_SITE_BUILD != '' && secrets.SUPERSET_SITE_BUILD != '') || '' }}
build-deploy: build-deploy:
needs: config needs: config
if: needs.config.outputs.has-secrets if: needs.config.outputs.has-secrets

View File

@@ -31,10 +31,12 @@ jobs:
id: check id: check
shell: bash shell: bash
run: | run: |
if [ -n "${{ (secrets.DOCKERHUB_USER != '' && secrets.DOCKERHUB_TOKEN != '') || '' }}" ]; then if [ -n "${DOCKERHUB_USER}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT" echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi fi
env:
DOCKERHUB_USER: ${{ (secrets.DOCKERHUB_USER != '' && secrets.DOCKERHUB_TOKEN != '') || '' }}
docker-release: docker-release:
needs: config needs: config
if: needs.config.outputs.has-secrets if: needs.config.outputs.has-secrets
@@ -72,17 +74,20 @@ jobs:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_RELEASE: ${{ github.event.inputs.release }}
INPUT_FORCE_LATEST: ${{ github.event.inputs.force-latest }}
INPUT_GIT_REF: ${{ github.event.inputs.git-ref }}
run: | run: |
RELEASE="${{ github.event.release.tag_name }}" RELEASE="${{ github.event.release.tag_name }}"
FORCE_LATEST="" FORCE_LATEST=""
EVENT="${{github.event_name}}" EVENT="${{github.event_name}}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
# in the case of a manually-triggered run, read release from input # in the case of a manually-triggered run, read release from input
RELEASE="${{ github.event.inputs.release }}" RELEASE="${INPUT_RELEASE}"
if [ "${{ github.event.inputs.force-latest }}" = "true" ]; then if [ "${INPUT_FORCE_LATEST}" = "true" ]; then
FORCE_LATEST="--force-latest" FORCE_LATEST="--force-latest"
fi fi
git checkout "${{ github.event.inputs.git-ref }}" git checkout "${INPUT_GIT_REF}"
EVENT="release" EVENT="release"
fi fi
@@ -122,6 +127,7 @@ jobs:
- name: Label the PRs with the right release-related labels - name: Label the PRs with the right release-related labels
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_RELEASE: ${{ github.event.inputs.release }}
run: | run: |
export GITHUB_ACTOR="" export GITHUB_ACTOR=""
git fetch --all --tags git fetch --all --tags
@@ -129,6 +135,6 @@ jobs:
RELEASE="${{ github.event.release.tag_name }}" RELEASE="${{ github.event.release.tag_name }}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
# in the case of a manually-triggered run, read release from input # in the case of a manually-triggered run, read release from input
RELEASE="${{ github.event.inputs.release }}" RELEASE="${INPUT_RELEASE}"
fi fi
supersetbot release-label $RELEASE supersetbot release-label $RELEASE

View File

@@ -19,10 +19,12 @@ jobs:
id: check id: check
shell: bash shell: bash
run: | run: |
if [ -n "${{ (secrets.GSHEET_KEY != '' ) || '' }}" ]; then if [ -n "${GSHEET_KEY}" ]; then
echo "has-secrets=1" >> "$GITHUB_OUTPUT" echo "has-secrets=1" >> "$GITHUB_OUTPUT"
fi fi
env:
GSHEET_KEY: ${{ (secrets.GSHEET_KEY != '' ) || '' }}
process-and-upload: process-and-upload:
needs: config needs: config
if: needs.config.outputs.has-secrets if: needs.config.outputs.has-secrets