-
github actions functions, if key and job statusgithub actions 2022. 3. 4. 17:58
Function example
ame: Function testing on: push jobs: functions: runs-on: ubuntu-latest steps: - name: dump run: | echo ${{ contains('hello', 'll') }} echo ${{ startsWith('hello', 'he') }} echo ${{ endsWith('hello', 'lo') }} echo ${{ format('Hello {0} {1} {2}', 'world', '!', '!') }}
If 사용하기
name: If key on: push jobs: dump_contexts_to_log: runs-on: ubuntu-latest if: github.event_name == 'push' steps: - name: Dump GitHub context id: github_context_step run: ecccho '${{ toJSON(github) }}' - name: Dump job context if: failure() run: echo '${{ toJSON(job) }}' - name: Dump steps context if: always() run: echo '${{ toJSON(steps) }}' - name: Dump runner context run: echo '${{ toJSON(runner) }}' - name: Dump strategy context run: echo '${{ toJSON(strategy) }}' - name: Dump matrix context run: echo '${{ toJSON(matrix) }}'
Dump GitHub context, Dump job context, Dump steps context 만 실행된 것에 유의한다.
'github actions' 카테고리의 다른 글
여러 node 버전을 동시에 사용하기 (0) 2022.03.07 Continue on Error & Timeout (0) 2022.03.06 github actions expressions & contexts (0) 2022.03.04 파일 암호화 하기 (0) 2022.03.04 GITHUB_TOKEN 사용하기 (0) 2022.03.02