Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snowdrop/export-github-flows
Project to test github actions and jobs
https://github.com/snowdrop/export-github-flows
Last synced: 5 days ago
JSON representation
Project to test github actions and jobs
- Host: GitHub
- URL: https://github.com/snowdrop/export-github-flows
- Owner: snowdrop
- Created: 2023-07-27T07:01:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-31T16:34:07.000Z (over 1 year ago)
- Last Synced: 2023-07-31T17:57:01.757Z (over 1 year ago)
- Language: Shell
- Size: 401 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Export "e2e" github workflows
This project aims to read [github workflows](https://docs.github.com/en/actions/quickstart) and to export in a txt file the `env` and `run` sections.
Why ? As the goal of a 2e2 test, played by a GitHub workflow, is to verify if the scenario which requires to potentially install many
components on the platform (kubernetes cluster, certificate manager, tekton pipeline, service binding, vault, crossplane etc)
works, the information such as `run:` or `run: |` or environment variables set `env:` could be more than valuable
for local debugging, fine-tuning, demo purposes.To play with it and export the information in a file, you can then use the following bash script and pass as parameter the file to be processed:
```bash
./scripts/export-jobs.sh
```
The script will then read the file and export the environment variables and each `run` blockExample of flow:
```yaml
name: gitHub Workflow sampleon:
push:
branches: [ main ]
paths-ignore:
- '*.md' # Ignores .md files at the root of the repository
- '**/*.md' # Ignores .md files within subdirectoriesenv:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}jobs:
job1:
env:
FIRST_NAME: Mona
LAST_NAME: Lisasteps:
- name: Install Dependencies
run: npm install- name: Clean install dependencies and build
run: |
npm ci
npm run build- name: Clean temp directory
run: rm -rf *
working-directory: ./temp
```And what we got:
**Important**: Some hacking will be needed as the script cannot figure out what the [GitHub default variables](https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables) are
and cannot perform substitution too.Example:
```yaml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Generated into:Enjoy to play with this project and improve it ;-)