mpalmer / action-validator

Tool to validate GitHub Action and Workflow YAML files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not check for context variable typos

AllanOricil opened this issue · comments

This workflow can't be compiled by github actions, but your tool can't find the problem

image

image

# assumption: every package can be deployed independently. It won't work in case there are tightly coupled dependencies.
name: Manual Package Deploy Workflow

on:
  workflow_call:
    inputs:
      PACKAGE_NAME:
        type: string
        required: true
      VALIDATION_ENVIRONMENTS:
        type: string
        required: true
      PRE_RELEASE_ENVIRONMENTS:
        type: string
        required: true
      RELEASE_ENVIRONMENT:
        type: string
        required: false
      SLACK_CHANNEL:
        type: string
        required: false
    secrets:
      SF_SFDX_AUTH_URL:
        required: true
      CODECOV_COVERAGE_UPLOAD_TOKEN:
        required: false
      SLACK_BOT_TOKEN:
        required: false

permissions:
  contents: write
  packages: read

jobs:
  
  validate-metadata-changes:
    name: Validate Metadata Changes
    strategy:
      matrix:
        environment: ${{ fromJSON(inputs.VALIDATION_ENVIRONMENTS) }}
    environment: ${{ matrix.environment }}
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/vodafoneis/salesforce-build-image:feature-MULE-3485
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}

    steps:
      - name: Print sfdx version
        run: sfdx version --verbose --json

      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 2

      - name: Checkout
        uses: actions/checkout@v3
        with:
          repository: VodafoneIS/salesforce-sandbox-management
          path: salesforce-sandbox-management

      - name: Setup Git User
        uses: fregante/setup-git-user@v1

      - name: Authenticate
        run: /scripts/authenticate.sh
        shell: bash
        env:
          SF_ORG_ALIAS: ${{ vars.SF_ORG_ALIAS }}
          SF_INSTANCE_URL: ${{ vars.SF_INSTANCE_URL }}
          SF_SFDX_AUTH_URL: ${{ secrets.SF_SFDX_AUTH_URL }}

      - name: Fetch Current Package Version
        id: fetch_current_package_version
        run: |
          current_package_version=$(sh ./salesforce-sandbox-management/fetch_package_version.sh -s ${{ matrix.environment }} -p ${{ inptus.PACKAGE_NAME }})
          echo "current_package_version=$current_package_version" >> $GITHUB_OUTPUT
      
      - name: Update Package Version
        run: |
          fetch_current_package_version=${{ steps.fetch_current_package_version.outputs.current_package_version}}
          sh ./salesforce-sandbox-management/update_package.sh -s ${{ matrix.environment }} -p ${{ inputs.PACKAGE_NAME }} -v $fetch_current_package_version

This seems to be a duplicate of #22. If you disagree, feel free to reopen with rationale.

It is a dup