Skip to content

Commit 73b09ab

Browse files
author
Nikolai Emil Damm
committed
refactor(workflows): simplify workflows by calling reusable workflows for README Tree and Todos
Signed-off-by: Nikolai Emil Damm <neq@energinet.dk>
1 parent 8f82e21 commit 73b09ab

File tree

2 files changed

+6
-67
lines changed

2 files changed

+6
-67
lines changed

.github/workflows/readme-tree.yaml

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,7 @@ on:
55
branches: [main]
66
workflow_dispatch:
77

8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref }}
10-
cancel-in-progress: true
11-
128
jobs:
13-
tree:
14-
runs-on: ubuntu-latest
15-
name: readme-tree
16-
steps:
17-
- uses: actions/checkout@v4
18-
- name: Create README Tree
19-
uses: RavelloH/readme-tree@v1.1.0
20-
with:
21-
showdirectoryname: "yes"
22-
- name: Generate GitHub App Token
23-
uses: actions/create-github-app-token@v1
24-
id: app-token
25-
with:
26-
app-id: ${{ secrets.APP_ID }}
27-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
28-
- name: Get GitHub App User ID
29-
id: get-user-id
30-
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
31-
env:
32-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
33-
- name: Create Pull Request
34-
id: create-pull-request
35-
uses: peter-evans/create-pull-request@v7
36-
with:
37-
branch: update-readme-tree
38-
commit-message: Update README Tree
39-
title: Update README Tree
40-
body: This PR includes new updates to the README Tree.
41-
labels: chore
42-
delete-branch: true
43-
reviewers: devantler
44-
assignees: devantler
45-
signoff: true
46-
token: ${{ steps.app-token.outputs.token }}
47-
author: ${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>
48-
committer: ${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>
49-
sign-commits: true
50-
- name: Enable Pull Request Automerge
51-
if: steps.create-pull-request.outputs.pull-request-operation != 'none'
52-
run: gh pr merge --merge --auto ${{ steps.create-pull-request.outputs.pull-request-number }}
53-
env:
54-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
55-
9+
call-readme-tree-workflow:
10+
uses: devantler-tech/.github/.github/workflows/readme-tree.yaml@main
11+
secrets: inherit

.github/workflows/todos.yaml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,7 @@ on:
33
push:
44
branches: [main]
55

6-
concurrency:
7-
group: ${{ github.workflow }}-${{ github.ref }}
8-
cancel-in-progress: true
9-
106
jobs:
11-
build:
12-
runs-on: "ubuntu-latest"
13-
steps:
14-
- uses: "actions/checkout@v4"
15-
- name: Generate GitHub App Token
16-
uses: actions/create-github-app-token@v1
17-
id: app-token
18-
with:
19-
app-id: ${{ secrets.APP_ID }}
20-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
21-
- uses: "alstr/todo-to-issue-action@v5"
22-
env:
23-
AUTO_ASSIGN: true
24-
CLOSE_ISSUES: true
25-
PROJECT: user/devantler/4
26-
PROJECTS_SECRET: ${{ steps.app-token.outputs.token }}
7+
call-todos-workflow:
8+
uses: devantler-tech/.github/.github/workflows/todos.yaml@main
9+
secrets: inherit

0 commit comments

Comments
 (0)