Skip to content

Commit

Permalink
fix: moved workflow files into the .github/workflows folder to run th…
Browse files Browse the repository at this point in the history
…e workflows
  • Loading branch information
prisis committed May 22, 2024
1 parent d966ade commit 8f8a32b
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 147 deletions.
8 changes: 4 additions & 4 deletions workflow/allo-allo.md → .github/workflows/allo-allo.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ on: # yamllint disable-line rule:truthy

jobs:
allo-allo:
uses: "anolilab/workflows/workflow/allo-allo.yml@main"
uses: "anolilab/workflows/.github/workflows/allo-allo.yml@main"
with:
target-repo: "anolilab/workflows"
issue-welcome: >
Expand Down Expand Up @@ -96,7 +96,7 @@ on: # yamllint disable-line rule:truthy

jobs:
allo-allo:
uses: "anolilab/workflows/workflow/allo-allo.yml@main"
uses: "anolilab/workflows/.github/workflows/allo-allo.yml@main"
with:
target-repo: "anolilab/workflows"
issue-welcome: |
Expand All @@ -122,7 +122,7 @@ on: # yamllint disable-line rule:truthy

jobs:
allo-allo:
uses: "anolilab/workflows/workflow/allo-allo.yml@main"
uses: "anolilab/workflows/.github/workflows/allo-allo.yml@main"
with:
target-repo: "anolilab/workflows"
pr-welcome: >
Expand All @@ -149,7 +149,7 @@ on: # yamllint disable-line rule:truthy

jobs:
allo-allo:
uses: "anolilab/workflows/workflow/allo-allo.yml@main"
uses: "anolilab/workflows/.github/workflows/allo-allo.yml@main"
with:
target-repo: "anolilab/workflows"
pr-merged: >
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on: # yamllint disable-line rule:truthy

jobs:
cleanup-branch-cache:
uses: "anolilab/workflows/workflow/cleanup-branch-cache.yml@main"
uses: "anolilab/workflows/.github/workflows/cleanup-branch-cache.yml@main"
with:
target-repo: "anolilab/workflows"
```
File renamed without changes.
4 changes: 2 additions & 2 deletions workflow/lock-closed.md → .github/workflows/lock-closed.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ on: # yamllint disable-line rule:truthy

jobs:
lock-closed:
uses: "anolilab/workflows/workflow/lock-closed.yml@main"
uses: "anolilab/workflows/.github/workflows/lock-closed.yml@main"
with:
target-repo: "anolilab/workflows"
```
Expand All @@ -98,7 +98,7 @@ on: # yamllint disable-line rule:truthy

jobs:
lock-closed:
uses: "anolilab/workflows/workflow/lock-closed.yml@main"
uses: "anolilab/workflows/.github/workflows/lock-closed.yml@main"
with:
issue-inactive-days: 42
target-repo: "anolilab/workflows"
Expand Down
File renamed without changes.
Empty file.
24 changes: 11 additions & 13 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
name: "Semantic Pull Request"

on: # yamllint disable-line rule:truthy
pull_request_target:
types:
- "opened"
- "reopened"
- "edited"
- "synchronize"
merge_group: # yamllint disable-line rule:empty-values
workflow_call:
inputs:
target-repo:
description: "The repo to run this action on. This is to prevent actions from running on forks unless intended."
required: true
type: "string"

permissions: {}
permissions:
contents: "read"

jobs:
main:
if: "github.repository == inputs.target-repo"
permissions:
pull-requests: "write" # to analyze PRs (amannn/action-semantic-pull-request)
statuses: "write" # to mark status of analyzed PR (amannn/action-semantic-pull-request)
Expand All @@ -36,20 +37,17 @@ jobs:
build
chore
ci
deps
docs
feat
fix
perf
infra
refactor
revert
security
style
test
translation
- uses: "marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31" # v2.9.0
# When the previous steps fails, the workflow would stop. By adding this
# When the previous steps fail, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: "always() && (steps.lint_pr_title.outputs.error_message != null)"
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ on: # yamllint disable-line rule:truthy

jobs:
set-default-labels:
uses: "anolilab/workflows/workflow/set-default-labels.yml@main"
uses: "anolilab/workflows/.github/workflows/set-default-labels.yml@main"
with:
target-repo: "anolilab/workflows"
```
Expand All @@ -73,7 +73,7 @@ on: # yamllint disable-line rule:truthy

jobs:
set-default-labels:
uses: "anolilab/workflows/workflow/set-default-labels.yml@main"
uses: "anolilab/workflows/.github/workflows/set-default-labels.yml@main"
with:
target-repo: "anolilab/workflows"
skip-delete: false
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on: # yamllint disable-line rule:truthy

jobs:
stale-issues:
uses: anolilab/workflows/workflow/stale-issues.yml@main
uses: anolilab/workflows/.github/workflows/stale-issues.yml@main
with:
target-repo: "anolilab/workflows"
```
19 changes: 13 additions & 6 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
# Note: this is a shared pipeline used by other repositories.
# Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows

name: "Close stale issues"
name: "Mark issues and pull requests as stale"

on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 0 * * *"
workflow_call:
inputs:
target-repo:
description: "The repo to run this action on. This is to prevent actions from running on forks unless intended."
required: true
type: "string"

permissions:
contents: "read"
Expand All @@ -15,6 +20,7 @@ jobs:
issues: "write" # for actions/stale to close stale issues
pull-requests: "write" # for actions/stale to close stale PRs
timeout-minutes: 1
if: "github.repository == inputs.target-repo"
runs-on: "ubuntu-latest"
steps:
- name: "Harden Runner"
Expand All @@ -40,6 +46,7 @@ jobs:
issues: "write" # for actions/stale to close stale issues
pull-requests: "write" # for actions/stale to close stale PRs
timeout-minutes: 1
if: "github.repository == inputs.target-repo"
runs-on: "ubuntu-latest"
steps:
- name: "Harden Runner"
Expand All @@ -63,6 +70,7 @@ jobs:
issues: "write" # for actions/stale to close stale issues
pull-requests: "write" # for actions/stale to close stale PRs
timeout-minutes: 1
if: "github.repository == inputs.target-repo"
runs-on: "ubuntu-latest"
steps:
- name: "Harden Runner"
Expand All @@ -86,9 +94,8 @@ jobs:
issues: "write" # for actions/stale to close stale issues
pull-requests: "write" # for actions/stale to close stale PRs
timeout-minutes: 1

if: "github.repository == inputs.target-repo"
runs-on: "ubuntu-latest"

steps:
- name: "Harden Runner"
uses: "step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4" # v2.7.1
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ configure the following:

### Workflows

- [allo-allo](./workflow/allo-allo.yml) ([docs](./workflow/allo-allo.md)) - a welcome bot for new contributors
- [lock-closed](./workflow/lock-closed.yml) ([docs](./workflow/lock-closed.md)) - locks issues and PRs that have been closed for more than a year
- [stale-issues](./workflow/stale-issues.yml) ([docs](./workflow/stale-issues.md)) - closes stale issues
- [set-default-labels](./workflow/set-default-labels.yml) ([docs](./workflow/set-default-labels.md)) - sets default labels on issues and PRs
- [allo-allo](./.github/workflows/allo-allo.yml) ([docs](./.github/workflows/allo-allo.md)) - a welcome bot for new contributors
- [cleanup-branch-cache](./.github/workflows/cleanup-branch-cache.yml) ([docs](./.github/workflows/cleanup-branch-cache.md)) - automatically cleans all cache key if a branch is closed.
- [lock-closed](./.github/workflows/lock-closed.yml) ([docs](./.github/workflows/lock-closed.md)) - locks issues and PRs that have been closed for more than a year
- [semantic-pull-request](./.github/workflows/semantic-pull-request.yml) ([docs](./.github/workflows/semantic-pull-request.md)) - validates if the PR title has a defined semantic title
- [set-default-labels](./.github/workflows/set-default-labels.yml) ([docs](./.github/workflows/set-default-labels.md)) - sets default labels on issues and PRs
- [stale-issues](./.github/workflows/stale-issues.yml) ([docs](./.github/workflows/stale-issues.md)) - closes stale issues

## Contributing

Expand Down
114 changes: 0 additions & 114 deletions workflow/stale-issues.yml

This file was deleted.

0 comments on commit 8f8a32b

Please sign in to comment.