https://github.com/hadialqattan/relies-on
A Github action to identify any workflows that must complete successfully before another workflow will run.
https://github.com/hadialqattan/relies-on
actions automation devops gh-actions workflows
Last synced: about 1 month ago
JSON representation
A Github action to identify any workflows that must complete successfully before another workflow will run.
- Host: GitHub
- URL: https://github.com/hadialqattan/relies-on
- Owner: hadialqattan
- License: mit
- Created: 2022-03-01T10:36:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-02T11:36:10.000Z (over 2 years ago)
- Last Synced: 2024-04-15T21:41:46.063Z (over 1 year ago)
- Topics: actions, automation, devops, gh-actions, workflows
- Language: Python
- Homepage:
- Size: 364 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A Github action to identify any workflows that must complete successfully before another workflow will run.
"Relies-on is to workflows asneeds
is to jobs" - Relies-on Author 😉##
##
## Why does Relies-on exist? 🛸
The main purpose of Relies-on is to identify any workflows that must complete
successfully before another workflow will run._(The idea behind this action is similar to Github's
needs
but at a workflows scale)._As an example of a situation where Relies-on comes in handy, let's imagine that you have
two different workflows one called `CI` and another called `CD` assuming the `CD`
workflow will do a critical thing that mustn't be performed only if the latest run of
the `CI` workflow succeeded. One approach to solve this problem is to check the status
of the latest `CI` run manually, but the problem with this approach is the ability to
run the `CD` workflow (doing the critical thing) whether the latest `CI` workflow run
was succeeded or not, which is not totally safe because there is no actual restriction,
therefore Relies-on comes into existence.## How could aliens use this action? 👽
Here's a simple example to get started (assuming we have another workflow called `CI`):
```yml
# This is a CD system. It should publish a new release
# if and only if the lastest run of the CI workflow has succeeded.
name: CDon:
push:
tags:
- "v*.*.*"jobs:
check_ci_status:
name: Check the CI Workflow's Status
runs-on: ubuntu-latest
steps:
- uses: hadialqattan/relies-on@v1.0.0
with:
workflow: CIdeployment:
name: Deployment job
needs: check_ci_status
...
```This would terminate the `CD` workflow if the latest `CI` workflow run faild.
**Optional action inputs (arguments):**
```yml
owner:
The username of the owner of the repository containing the workflow. [default=currect
repository owner username]repository:
The name of the repository containing the workflow. [default=current repository name]workflow: The name of the workflow that would be checked.
branch:
The name of the branch where the workflow runs. [default=repository's default branch
(most likely master or main)]event: The type of the event that triggers the workflow. [default= ]
exclude_pull_requests: If true pull requests based runs are omitted. [default=true]
# Falsy values: "n", "no", "f", "false", "off", "0"
# Truthy values: "y", "yes", "t", "true", "on", "1"
```## Changelog 🆕
All notable changes to this project will be documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).### [Unreleased]
### [1.0.0] - 2022-04-26
#### Added
- [First published version](https://github.com/marketplace/actions/relies-on), Happy 🍰
Day 2022!
- [Semantically versioned](https://semver.org/spec/v2.0.0.html)
- [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) formatted.## Authors 👤
Authors:
- Hadi Alqattan ([@hadialqattan](https://github.com/hadialqattan))
Contributors:
## Contributing ✨
A big welcome for considering contributing to make the project better. In general, we
follow the ["fork-and-pull"](https://github.com/susam/gitpr) Git workflow:1. Fork the repository to your own Github account.
2. Clone the project to your machine.
3. Create a branch locally.
4. Commit changes to the branch.
5. Follow any formatting and testing guidelines specific to this repo
(`pre-commit install`).
6. Push changes to your fork.
7. Open a PR in our repository.## Code of Conduct ❤️
Everyone participating in the Relies-on project, and in particular in the issue tracker,
and pull requests is expected to treat other people with respect.## License 🚓
This project is licensed under an [MIT](./LICENSE) license.
##
Give a ⭐️ if this project helped you!