mirror of
https://github.com/saltstack/salt.git
synced 2025-04-10 23:01:39 +00:00
34 lines
1.5 KiB
Django/Jinja
34 lines
1.5 KiB
Django/Jinja
|
|
<%- set job_name = "workflow-requirements" %>
|
|
|
|
<{ job_name }>:
|
|
<%- do prepare_workflow_needs.append(job_name) %>
|
|
name: Check Workflow Requirements
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
requirements-met: ${{ steps.check-requirements.outputs.requirements-met }}
|
|
steps:
|
|
- name: Check Requirements
|
|
id: check-requirements
|
|
run: |
|
|
if [ "${{ vars.RUN_SCHEDULED_BUILDS }}" = "1" ]; then
|
|
MSG="Running workflow because RUN_SCHEDULED_BUILDS=1"
|
|
echo "${MSG}"
|
|
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "requirements-met=true" >> "${GITHUB_OUTPUT}"
|
|
elif [ "${{ github.event.repository.fork }}" = "true" ]; then
|
|
MSG="Not running workflow because ${{ github.repository }} is a fork"
|
|
echo "${MSG}"
|
|
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "requirements-met=false" >> "${GITHUB_OUTPUT}"
|
|
elif [ "${{ github.event.repository.private }}" = "true" ]; then
|
|
MSG="Not running workflow because ${{ github.repository }} is a private repository"
|
|
echo "${MSG}"
|
|
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "requirements-met=false" >> "${GITHUB_OUTPUT}"
|
|
else
|
|
MSG="Running workflow because ${{ github.repository }} is not a fork"
|
|
echo "${MSG}"
|
|
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "requirements-met=true" >> "${GITHUB_OUTPUT}"
|
|
fi
|