GH env #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: GH env | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ branch-1 ] | |
pull_request: | |
branches: [ branch-1 ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
channel: | |
description: 'release channel' | |
required: true | |
type: choice | |
options: | |
- gov | |
env: | |
VER: v2 | |
CHANNEL: ${{ github.event.inputs.channel }} | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# - uses: actions/checkout@${{ env.VER }} | |
- name: debug GITHUB_SHA '${{ env.GITHUB_SHA }}' and '${{ github.sha }}' | |
run: | | |
echo "PWD is [$PWD]" | |
echo "env.GITHUB_SHA is [${{ env.GITHUB_SHA }}]" | |
echo "env GITHUB_SHA is [$GITHUB_SHA]" | |
echo "github.sha is [${{ github.sha }}]" | |
# Runs a single command using the runners shell | |
- name: Dump all GH default varaibles ${{ env.VER }} | |
run: | | |
#cat ${GITHUB_ENV} | |
#env | |
echo "" | |
echo "-----------------------------------------------------------------------------" | |
if [[ ${GITHUB_EVENT_NAME} == "push" ]]; then | |
BRF_BRANCH=${GITHUB_REF_NAME} | |
elif [[ ${GITHUB_EVENT_NAME} == "pull_request" ]]; then | |
BRF_BRANCH=${GITHUB_HEAD_REF} | |
fi | |
echo "BRF_BRANCH is [${BRF_BRANCH}]" | |
echo "GITHUB_REPOSITORY is [${GITHUB_REPOSITORY}]" | |
echo "GITHUB_EVENT_NAME is [${GITHUB_EVENT_NAME}]" | |
echo "GITHUB_HEAD_REF is [${GITHUB_HEAD_REF}]" | |
echo "GITHUB_BASE_REFis [${GITHUB_BASE_REF}]" | |
echo "BRF_BRANCH=${BRF_BRANCH}" >> $GITHUB_ENV | |
echo "" | |
# Runs a set of commands using the runners shell | |
- name: Run a multi-line script | |
run: | | |
echo "-----------------------------------------------------------------------------" | |
echo "BRF_BRANCH is [${BRF_BRANCH}]" - name: use the repo and branch name to create filter file for the snyk projects | |
cat $GITHUB_ENV | |
cat <<- EOF > ggg | |
{ | |
"filters": { | |
"tags": { | |
"includes": [ | |
{ | |
"key": "repo", | |
"value": "aaa" | |
}, | |
{ | |
"key": "branch", | |
"value": "bbb" | |
} | |
] | |
} | |
} | |
} | |
EOF | |
cat ggg | |
- name: bash version | |
run: | | |
bash --version | |
- name: yq version | |
run: | | |
yq --version | |
echo "CHANNEL is [$CHANNEL]" | |
echo "===== invoke resolvectl flush-caches" | |
resolvectl flush-caches | |
echo "===== invoke resolvectl status" | |
resolvectl status | |