Skip to content

Commit 6954705

Browse files
✨ feat: adds flat format output (#2)
## πŸ’Œ Description flat format output ## πŸ”— Related issue <!-- If your PR refers to a related issue, link it here. --> Fixes: # ## πŸ—οΈ Type of change <!-- Mark with an `x` all the checkboxes that apply (like `[x]`) --> - [ ] πŸ“š Examples / docs / tutorials - [ ] πŸ› Bug fix (non-breaking change which fixes an issue) - [ ] πŸ₯‚ Improvement (non-breaking change which improves an existing feature) - [ ] πŸš€ New feature (non-breaking change which adds functionality) - [ ] πŸ’₯ Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🚨 Security fix - [ ] ⬆️ Dependencies update ## βœ… Checklist <!-- Mark with an `x` all the checkboxes that apply (like `[x]`) --> - [ ] I've read the [`Code of Conduct`](https://github.com/raven-actions/get-repos/blob/main/.github/CODE_OF_CONDUCT.md)> document. - [ ] I've read the [`Contributing`](https://github.com/raven-actions/get-repos/blob/main/.github/CONTRIBUTING.md) guide.
1 parent a0fdd5c commit 6954705

File tree

9 files changed

+172
-143
lines changed

9 files changed

+172
-143
lines changed
File renamed without changes.

β€Ž.github/stale.ymlβ€Ž

Lines changed: 0 additions & 17 deletions
This file was deleted.

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
pull_request:
66
branches:
77
- main
8+
types:
9+
- opened
10+
- ready_for_review
11+
- synchronize
12+
- reopened
813
push:
914
branches:
1015
- main
@@ -27,47 +32,15 @@ env:
2732
DEBUG: ${{ inputs.debug || secrets.ACTIONS_RUNNER_DEBUG || vars.ACTIONS_RUNNER_DEBUG || secrets.ACTIONS_STEP_DEBUG || vars.ACTIONS_STEP_DEBUG || false }}
2833

2934
jobs:
30-
validate:
31-
name: Validate
32-
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) }}
33-
runs-on: ubuntu-latest
34-
permissions:
35-
contents: read
36-
pull-requests: read
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v3
40-
41-
- name: Detect changes
42-
uses: dorny/paths-filter@v2
43-
id: changes
44-
with:
45-
filters: |
46-
gh-workflows:
47-
- '.github/workflows/**'
48-
md:
49-
- '**/*.md'
50-
51-
- name: actionlint
52-
if: ${{ steps.changes.outputs.gh-workflows == 'true' }}
53-
uses: raven-actions/actionlint@v1
54-
with:
55-
flags: "-ignore SC2086"
56-
57-
- name: Markdown Links
58-
if: ${{ steps.changes.outputs.md == 'true' }}
59-
uses: gaurav-nelson/github-action-markdown-link-check@v1
60-
with:
61-
config-file: .github/linters/.markdown-link-check.json
62-
6335
dog-food:
6436
name: Dog food
6537
runs-on: ubuntu-latest
6638
outputs:
6739
repos: ${{ steps.get-repos.outputs.repos }}
6840
count: ${{ steps.get-repos.outputs.count }}
41+
format: ${{ steps.get-repos.outputs.format }}
6942
steps:
70-
- name: Debug Action
43+
- name: Debug
7144
if: ${{ env.DEBUG == 'true' }}
7245
uses: raven-actions/debug@v1
7346
with:
@@ -79,11 +52,29 @@ jobs:
7952
- name: Checkout
8053
uses: actions/checkout@v3
8154

82-
- name: Get Repositories Action
55+
- name: Get Repositories Action (json)
8356
id: get-repos
8457
uses: ./
8558
with:
86-
topics: "raven-actions"
59+
topics: "raven-actions,composite-action"
60+
61+
- name: Get Repositories Action (flat)
62+
id: get-repos-flat
63+
uses: ./
64+
with:
65+
topics: "raven-actions,composite-action,debug"
66+
format: flat
67+
68+
- name: Test flat output
69+
run: |
70+
echo "Total count: ${COUNT}"
71+
echo "Format: ${FORMAT}"
72+
echo "Repos:"
73+
echo -e "${REPOS}"
74+
env:
75+
REPOS: ${{ steps.get-repos-flat.outputs.repos }}
76+
COUNT: ${{ steps.get-repos-flat.outputs.count }}
77+
FORMAT: ${{ steps.get-repos-flat.outputs.format }}
8778

8879
test-matrix:
8980
name: Test matrix (${{ matrix.repo.name }})
@@ -100,10 +91,12 @@ jobs:
10091
- name: Test
10192
run: |
10293
echo "Total count: ${COUNT}"
94+
echo "Format: ${FORMAT}"
10395
echo "Repo: ${REPO}"
10496
env:
10597
REPO: ${{ toJson(matrix.repo) }}
10698
COUNT: ${{ needs.dog-food.outputs.count }}
99+
FORMAT: ${{ needs.dog-food.outputs.format }}
107100

108101
dog-food-matrix:
109102
name: Dog food (${{ matrix.os }})
@@ -132,18 +125,22 @@ jobs:
132125
if: ${{ runner.os != 'Windows' }}
133126
run: |
134127
echo "Total count: ${COUNT}"
128+
echo "Format: ${FORMAT}"
135129
echo "Repos: ${REPOS}"
136130
shell: bash
137131
env:
138132
REPOS: ${{ toJson(steps.get-repos.outputs.repos) }}
139133
COUNT: ${{ steps.get-repos.outputs.count }}
134+
FORMAT: ${{ steps.get-repos.outputs.format }}
140135

141136
- name: Test
142137
if: ${{ runner.os == 'Windows' }}
143138
run: |
144139
Write-Output "Total count: ${env:COUNT}"
140+
Write-Output "Format: ${env:FORMAT}"
145141
Write-Output "Repos: ${env:REPOS}"
146142
shell: pwsh
147143
env:
148144
REPOS: ${{ toJson(steps.get-repos.outputs.repos) }}
149145
COUNT: ${{ steps.get-repos.outputs.count }}
146+
FORMAT: ${{ steps.get-repos.outputs.format }}

β€Ž.github/workflows/linter.ymlβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Linter
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
types:
9+
- opened
10+
- ready_for_review
11+
- synchronize
12+
- reopened
13+
push:
14+
branches:
15+
- main
16+
17+
jobs:
18+
linter:
19+
name: Linter
20+
uses: raven-actions/.workflows/.github/workflows/__linter.yml@main
21+
secrets: inherit

β€Ž.github/workflows/release-draft.ymlβ€Ž

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,9 @@ on:
55
push:
66
branches:
77
- main
8-
workflow_dispatch:
9-
# pull_request:
10-
# # Only following types are handled by the action, but one can default to all as well
118

129
jobs:
1310
draft-release:
14-
if: ${{ github.repository_owner == 'raven-actions' }}
1511
name: Draft Release
16-
permissions:
17-
contents: write
18-
pull-requests: read
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Get GitHub App Token
22-
uses: wow-actions/use-app-token@v2
23-
id: get-token
24-
with:
25-
app_id: ${{ secrets.ORG_BOT_APP_ID }}
26-
private_key: ${{ secrets.ORG_BOT_PRIVATE_KEY }}
27-
fallback: ${{ github.token }}
28-
29-
- name: Run Release Drafter
30-
uses: release-drafter/release-drafter@v5
31-
id: release-drafter
32-
with:
33-
prerelease: true
34-
env:
35-
GITHUB_TOKEN: ${{ steps.get-token.outputs.BOT_TOKEN }}
36-
37-
- name: Get Release URL
38-
run: |
39-
echo "${RELEASE_URL}"
40-
echo "${RELEASE_URL}" >> $GITHUB_STEP_SUMMARY
41-
env:
42-
RELEASE_URL: ${{ steps.release-drafter.outputs.html_url }}
12+
uses: raven-actions/.workflows/.github/workflows/__release-draft.yml@main
13+
secrets: inherit

β€Ž.github/workflows/release-publish.ymlβ€Ž

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,10 @@ on:
1212
description: Tag name that the major tag will point to
1313
required: true
1414

15-
env:
16-
TAG_NAME: ${{ github.event.inputs.tag-name || github.event.release.tag_name }}
17-
1815
jobs:
19-
gh-release-update:
20-
name: GitHub Release
21-
permissions:
22-
contents: write
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Get GitHub App Token
26-
uses: wow-actions/use-app-token@v2
27-
id: get-token
28-
with:
29-
app_id: ${{ secrets.ORG_BOT_APP_ID }}
30-
private_key: ${{ secrets.ORG_BOT_PRIVATE_KEY }}
31-
fallback: ${{ github.token }}
32-
33-
- name: Update release to the latest
34-
id: gh-release
35-
uses: softprops/action-gh-release@v1
36-
with:
37-
prerelease: false
38-
token: ${{ steps.get-token.outputs.BOT_TOKEN }}
39-
40-
- name: Update the major tag to include the ${{ env.TAG_NAME }} changes
41-
id: update-major-tag
42-
uses: actions/[email protected]
43-
with:
44-
source-tag: ${{ env.TAG_NAME }}
45-
token: ${{ steps.get-token.outputs.BOT_TOKEN }}
16+
publish-release:
17+
name: Publish Release
18+
uses: raven-actions/.workflows/.github/workflows/__release-publish.yml@main
19+
secrets: inherit
20+
with:
21+
tag-name: ${{ github.event.inputs.tag-name || github.event.release.tag_name }}

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
- "--no-sort-keys"
2929
exclude: "package-lock.json|.vscode/.*"
3030
- id: end-of-file-fixer
31-
- id: no-commit-to-branch
31+
# - id: no-commit-to-branch
3232
- id: check-executables-have-shebangs
3333
- id: check-vcs-permalinks
3434

@@ -44,12 +44,12 @@ repos:
4444
- id: gitleaks
4545
args:
4646
- --config
47-
- ".github/linters/.gitleak.toml"
47+
- ".github/linters/.gitleaks.toml"
4848

49-
- repo: https://github.com/rhysd/actionlint
50-
rev: v1.6.24
51-
hooks:
52-
- id: actionlint
53-
args:
54-
- "-ignore"
55-
- "SC2086"
49+
# - repo: https://github.com/rhysd/actionlint
50+
# rev: v1.6.24
51+
# hooks:
52+
# - id: actionlint
53+
# args:
54+
# - "-ignore"
55+
# - "SC2086"

0 commit comments

Comments
Β (0)