Skip to content

Commit

Permalink
Template repository changes: remal-github-actions/template-typescript (
Browse files Browse the repository at this point in the history
…#715)

Co-authored-by: remal-github-actions <77626445+remal-github-actions+sync-with-template@users.noreply.github.com>
  • Loading branch information
remal and remal-github-actions authored Nov 15, 2024
1 parent e0722d9 commit 514e788
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 86 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/bump-repository-activity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ env:
PUSH_BACK_TOKEN: ${{secrets.PUSH_BACK_TOKEN}}

jobs:
rate-limits:
name: Check rate limits
bump-repository-activity:
name: Bump repository activity
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
Expand All @@ -24,14 +24,14 @@ jobs:
steps:
- name: Get rate limits
uses: remal-github-actions/get-rate-limits@v1
id: getRateLimits
id: rate-limits
with:
githubToken: ${{env.PUSH_BACK_TOKEN || github.token}}
- name: Make decision
- name: Make rate limits decision
id: decision
run: |
echo "Core rate limit usage: ${{steps.getRateLimits.outputs.coreUsage}}"
if [ "${{steps.getRateLimits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Core rate limit usage: ${{steps.rate-limits.outputs.coreUsage}}"
if [ "${{steps.rate-limits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Enough rate limits"
echo 'enough=true' >> $GITHUB_OUTPUT
else
Expand All @@ -41,22 +41,9 @@ jobs:
fi
echo 'enough=false' >> $GITHUB_OUTPUT
fi
outputs:
enough: ${{steps.decision.outputs.enough}}
bump-repository-activity:
needs:
- rate-limits
if: ${{github.event_name != 'schedule' || fromJSON(needs.rate-limits.outputs.enough) == true}}
name: Bump repository activity
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: bump-repository-activity
cancel-in-progress: true
steps:
- name: Bump repository activity
if: ${{env.PUSH_BACK_TOKEN}}
if: ${{env.PUSH_BACK_TOKEN && (github.event_name != 'schedule' || fromJSON(steps.decision.outputs.enough) == true)}}
uses: remal-github-actions/bump-repository-activity@v1
with:
githubToken: ${{env.PUSH_BACK_TOKEN}}
Expand Down
30 changes: 9 additions & 21 deletions .github/workflows/check-action-secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ defaults:
shell: bash

jobs:
rate-limits:
name: Check rate limits
check-action-secrets:
name: Check action secrets
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 10
concurrency:
group: check-action-secrets
cancel-in-progress: true
steps:
- name: Get rate limits
uses: remal-github-actions/get-rate-limits@v1
id: getRateLimits
id: rate-limits
with:
githubToken: ${{secrets.LIST_SECRETS || github.token}}
- name: Make decision
githubToken: ${{env.PUSH_BACK_TOKEN || github.token}}
- name: Make rate limits decision
id: decision
run: |
echo "Core rate limit usage: ${{steps.getRateLimits.outputs.coreUsage}}"
if [ "${{steps.getRateLimits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Core rate limit usage: ${{steps.rate-limits.outputs.coreUsage}}"
if [ "${{steps.rate-limits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Enough rate limits"
echo 'enough=true' >> $GITHUB_OUTPUT
else
Expand All @@ -43,21 +43,9 @@ jobs:
fi
echo 'enough=false' >> $GITHUB_OUTPUT
fi
outputs:
enough: ${{steps.decision.outputs.enough}}
check-action-secrets:
needs:
- rate-limits
if: ${{github.event_name != 'schedule' || fromJSON(needs.rate-limits.outputs.enough) == true}}
name: Check action secrets
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: check-action-secrets
cancel-in-progress: true
steps:
- name: Check action secrets
if: ${{github.event_name != 'schedule' || fromJSON(steps.decision.outputs.enough) == true}}
uses: remal-github-actions/check-action-secrets@v1
with:
githubToken: ${{secrets.LIST_SECRETS}}
6 changes: 3 additions & 3 deletions .github/workflows/codeowners-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
steps:
- name: Get rate limits
uses: remal-github-actions/get-rate-limits@v1
id: getRateLimits
id: rate-limits
with:
githubToken: ${{env.VALIDATION_TOKEN || github.token}}
- name: Make decision
id: decision
run: |
echo "Core rate limit usage: ${{steps.getRateLimits.outputs.coreUsage}}"
if [ "${{steps.getRateLimits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Core rate limit usage: ${{steps.rate-limits.outputs.coreUsage}}"
if [ "${{steps.rate-limits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Enough rate limits"
echo 'enough=true' >> $GITHUB_OUTPUT
else
Expand Down
28 changes: 8 additions & 20 deletions .github/workflows/rebase-dependabot-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ env:
PUSH_BACK_TOKEN: ${{secrets.PUSH_BACK_TOKEN || github.token}}

jobs:
rate-limits:
name: Check rate limits
rebase-dependabot-pull-requests:
name: Rebase Dependabot pull requests
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 15
concurrency:
group: rebase-dependabot-pull-requests
cancel-in-progress: true
steps:
- name: Get rate limits
uses: remal-github-actions/get-rate-limits@v1
id: getRateLimits
id: rate-limits
with:
githubToken: ${{env.PUSH_BACK_TOKEN || github.token}}
- name: Make decision
- name: Make rate limits decision
id: decision
run: |
echo "Core rate limit usage: ${{steps.getRateLimits.outputs.coreUsage}}"
if [ "${{steps.getRateLimits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Core rate limit usage: ${{steps.rate-limits.outputs.coreUsage}}"
if [ "${{steps.rate-limits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Enough rate limits"
echo 'enough=true' >> $GITHUB_OUTPUT
else
Expand All @@ -46,21 +46,9 @@ jobs:
fi
echo 'enough=false' >> $GITHUB_OUTPUT
fi
outputs:
enough: ${{steps.decision.outputs.enough}}
rebase-dependabot-pull-requests:
needs:
- rate-limits
if: ${{github.event_name != 'schedule' || fromJSON(needs.rate-limits.outputs.enough) == true}}
name: Rebase Dependabot pull requests
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: rebase-dependabot-pull-requests
cancel-in-progress: true
steps:
- name: Rebase Dependabot pull requests
if: ${{github.event_name != 'schedule' || fromJSON(steps.decision.outputs.enough) == true}}
uses: remal-github-actions/rebase-dependabot-pull-requests@v1
with:
githubToken: ${{env.PUSH_BACK_TOKEN}}
26 changes: 25 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,34 @@ permissions:
pull-requests: write

jobs:
update_release_draft:
update-release-draft:
name: Update release draft
runs-on: ubuntu-latest
concurrency:
group: update-release-draft
cancel-in-progress: true
steps:
- uses: actions/github-script@v7
name: Check if Release Drafter config exists in the repository
id: config
with:
script: |
const configFile = '.github/release-drafter.yml'
const configFileExists = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: context.repo.repo,
path: configFile,
}).then(
() => true,
error => { if (error.response && error.response.status === 404) return false; else throw error; }
)
if (!configFileExists) {
core.info("Config file doesn't exist: " + configFile)
}
core.setOutput('exists', configFileExists ? 'true' : 'false')
- uses: release-drafter/release-drafter@v6
name: Update release draft
if: ${{fromJSON(steps.config.outputs.exists) == true}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
29 changes: 8 additions & 21 deletions .github/workflows/sync-with-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ env:
PUSH_BACK_TOKEN: ${{secrets.PUSH_BACK_TOKEN}}

jobs:
rate-limits:
name: Check rate limits
sync-with-template:
name: Sync with template repository
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 30
concurrency:
group: sync-with-template
cancel-in-progress: true
steps:
- name: Get rate limits
uses: remal-github-actions/get-rate-limits@v1
id: getRateLimits
id: rate-limits
with:
githubToken: ${{env.PUSH_BACK_TOKEN || github.token}}
- name: Make decision
- name: Make rate limits decision
id: decision
run: |
echo "Core rate limit usage: ${{steps.getRateLimits.outputs.coreUsage}}"
if [ "${{steps.getRateLimits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Core rate limit usage: ${{steps.rate-limits.outputs.coreUsage}}"
if [ "${{steps.rate-limits.outputs.coreUsage < 75}}" == "true" ]; then
echo "Enough rate limits"
echo 'enough=true' >> $GITHUB_OUTPUT
else
Expand All @@ -48,22 +48,9 @@ jobs:
fi
echo 'enough=false' >> $GITHUB_OUTPUT
fi
outputs:
enough: ${{steps.decision.outputs.enough}}
sync-with-template:
needs:
- rate-limits
if: ${{github.event_name != 'schedule' || fromJSON(needs.rate-limits.outputs.enough) == true}}
name: Sync with template repository
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: sync-with-template
cancel-in-progress: true
steps:
- name: Sync with template repository
if: ${{env.PUSH_BACK_TOKEN}}
if: ${{env.PUSH_BACK_TOKEN && (github.event_name != 'schedule' || fromJSON(steps.decision.outputs.enough) == true)}}
uses: remal-github-actions/sync-with-template@v3
with:
githubToken: ${{env.PUSH_BACK_TOKEN}}
Expand Down

0 comments on commit 514e788

Please sign in to comment.