Skip to content

Commit

Permalink
Merge branch 'git-commit-push-action-7191511992-windows-full-remote' …
Browse files Browse the repository at this point in the history
…into windows
GuillaumeFalourd authored and GuillaumeFalourd committed Dec 13, 2023
2 parents 7e9b993 + f4e0ab9 commit 0471aca
Showing 8 changed files with 71 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/02-secret-workflow.yml
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ jobs:
owner: 'GuillaumeFalourd'
repository: 'formulas-training'
access-token: ${{ secrets.ACCESS_TOKEN }}
branch: master

- name: Access cloned repository content
run: |
19 changes: 19 additions & 0 deletions .github/workflows/70-post-failure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 70 - Post Failure

on:
workflow_dispatch:

jobs:
force-failure:
runs-on: ubuntu-latest
steps:
- name: Force job failure
run: exit 1

post-failure:
runs-on: ubuntu-latest
needs: force-failure
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- name: Do something
run: echo "Do something"
27 changes: 27 additions & 0 deletions .github/workflows/71-many-outputs-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 71 - Many Outputs Python

on:
workflow_dispatch:

jobs:
python-script:
runs-on: ubuntu-latest
outputs:
test1: ${{ steps.script.outputs.TEST1 }}
test2: ${{ steps.script.outputs.TEST2 }}
test3: ${{ steps.script.outputs.TEST3 }}
steps:
- uses: actions/checkout@v4
- name: Execute Python script
id: script
run: python output_function.py

job2:
runs-on: ubuntu-latest
needs: python-script
steps:
- name: Print outputs
run: |
echo ${{ needs.python-script.outputs.test1 }}
echo ${{ needs.python-script.outputs.test2 }}
echo ${{ needs.python-script.outputs.test3 }}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -310,3 +310,15 @@ This workflow illustrates how to extract a specific item from a JSON list stored
[![68 - OS Types](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/68-ostypes.yml/badge.svg)](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/68-ostypes.yml)

This workflow shows the os type value for each github runner os.

[![69 - Run on Push to RC](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/69-run-on-push-to-rc.yml/badge.svg)](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/69-run-on-push-to-rc.yml)

This workflow illustrates how to extract a semantic version from a Release Candidate branch name.

[![70 - Post Failure](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/70-post-failure.yml/badge.svg)](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/70-post-failure.yml)

This workflow illustrates how to execute a job when a previous job fails (post failure operations).

[![71 - Many Outputs Python](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/71-many-outputs-python.yml/badge.svg)](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/71-many-outputs-python.yml)

This workflow illustrates how to save many outputs using a python script and the GITHUB_OUTPUT file.
2 changes: 1 addition & 1 deletion backup/checkout-workflow.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Mon Dec 11 01:15:43 UTC 2023
Tue Dec 12 01:15:43 UTC 2023
2 changes: 1 addition & 1 deletion backup/pull-request-workflow.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fri Dec 8 06:22:59 UTC 2023
Mon Dec 11 06:23:29 UTC 2023
9 changes: 9 additions & 0 deletions output_function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os

def save_output(name: str, value: str):
with open(os.environ['GITHUB_OUTPUT'], 'a') as output_file:
print(f'{name}={value}', file=output_file)

save_output('TEST1', 'VALUE1')
save_output('TEST2', 'VALUE2')
save_output('TEST3', 'VALUE3')
2 changes: 1 addition & 1 deletion windows_report_full_remote.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Tue Dec 12 06:20:56 CUT 2023
Wed Dec 13 06:20:33 CUT 2023

0 comments on commit 0471aca

Please sign in to comment.