Skip to content

Commit

Permalink
write valid bash elif
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanphan committed Sep 12, 2024
1 parent 2e0888d commit 2ca16e7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/deploy-program.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ jobs:
- name: Check tag
id: set_program
run: |
if [[ "${{ inputs.git_ref }}" == "release/candy-guard@*" ]]; then
if [[ "${{ inputs.git_ref }}" =~ ^release/candy-guard@* ]]; then
echo program="candy-guard" >> $GITHUB_OUTPUT
echo type="release" >> $GITHUB_OUTPUT
else if [[ "${{ inputs.git_ref }}" == "release/candy-machine-core@*" ]]; then
elif [[ "${{ inputs.git_ref }}" =~ ^release/candy-machine-core@* ]]; then
echo program="candy-machine-core" >> $GITHUB_OUTPUT
echo type="relase" >> $GITHUB_OUTPUT
else if [[ "${{ inputs.git_ref }}" == "candy-machine-core" || "${{ inputs.git_ref }}" == "candy-guard" ]]; then
elif [[ "${{ inputs.git_ref }}" == "candy-machine-core" || "${{ inputs.git_ref }}" == "candy-guard" ]]; then
echo program="${{ inputs.program }}" >> $GITHUB_OUTPUT
echo type="ref" >> $GITHUB_OUTPUT
else
Expand Down Expand Up @@ -115,25 +115,25 @@ jobs:
# We do this if waterfall because github actions does not allow dynamic access to secrets
if [ "${{ inputs.cluster }}" == "devnet" ]; then
echo RPC=${{ secrets.DEVNET_RPC }} >> $GITHUB_ENV
else if [ "${{ inputs.cluster }}" == "mainnet-beta" ]; then
elif [ "${{ inputs.cluster }}" == "mainnet-beta" ]; then
echo RPC=${{ secrets.MAINNET_RPC }} >> $GITHUB_ENV
else if [ "${{ inputs.cluster }}" == "sonic-devnet" ]; then
elif [ "${{ inputs.cluster }}" == "sonic-devnet" ]; then
echo RPC=${{ secrets.SONIC_DEVNET_RPC }} >> $GITHUB_ENV
else if [ "${{ inputs.cluster }}" == "sonic-testnet" ]; then
elif [ "${{ inputs.cluster }}" == "sonic-testnet" ]; then
echo RPC=${{ secrets.SONIC_TESTNET_RPC }} >> $GITHUB_ENV
else if [ "${{ inputs.cluster }}" == "eclipse-devnet" ]; then
elif [ "${{ inputs.cluster }}" == "eclipse-devnet" ]; then
echo RPC=${{ secrets.ECLIPSE_DEVNET_RPC }} >> $GITHUB_ENV
else if [ "${{ inputs.cluster }}" == "eclipse-testnet" ]; then
elif [ "${{ inputs.cluster }}" == "eclipse-testnet" ]; then
echo RPC=${{ secrets.ECLIPSE_TESTNET_RPC }} >> $GITHUB_ENV
else if [ "${{ inputs.cluster }}" == "eclipse-mainnet" ]; then
elif [ "${{ inputs.cluster }}" == "eclipse-mainnet" ]; then
echo RPC=${{ secrets.ECLIPSE_MAINNET_RPC }} >> $GITHUB_ENV
fi
- name: Identify Program
run: |
if [[ "${{ inputs.cluster }}" == "sonic"* ]]; then
echo ${{ secrets.CORE_CANDY_MACHINE_SONIC_DEPLOY_KEY }} > ./deploy-key.json
else if [[ "${{ inputs.cluster }}" == "eclipse"* ]]; then
elif [[ "${{ inputs.cluster }}" == "eclipse"* ]]; then
echo ${{ secrets.CORE_CANDY_MACHINE_ECLIPSE_DEPLOY_KEY }} > ./deploy-key.json
fi
if [ "${{ needs.check_tag.outputs.program }}" == "candy-guard" ]; then
Expand Down

0 comments on commit 2ca16e7

Please sign in to comment.