Skip to content

Commit

Permalink
🔄 synced file(s) with dealroom/core-mothership (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: dealroomba-app[bot] <189869926+dealroomba-app[bot]@users.noreply.github.com>
  • Loading branch information
dealroomba-app[bot] authored Dec 9, 2024
1 parent 3734f97 commit a1fa53c
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ rules:
new-lines:
type: unix
trailing-spaces: disable
quoted-strings:
# Note: This should be set to "only-when-needed" however too
# much work until Prettier is able to handle this correctly.
# @see: https://github.com/prettier/prettier/issues/16037
required: false
2 changes: 2 additions & 0 deletions .github/scripts/delete-unused-labels/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ WANT_LABELS=(
"update-major"
"update-minor"
"update-patch"
"update-digest"
"dependencies"
"force-lint"
"low-risk"
Expand All @@ -14,6 +15,7 @@ WANT_LABELS=(
"auto-docs"
"do-not-merge"
"stale"
"pre-release"
)
IFS=$'\n' read -r -d '' -a label_array <<<"$LABELS"
for label in "${label_array[@]}"; do
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
||
contains(steps.pr-labels.outputs.labels, 'update-patch')
||
contains(steps.pr-labels.outputs.labels, 'update-digest')
||
contains(steps.pr-labels.outputs.labels, 'sync')
||
contains(steps.pr-labels.outputs.labels, 'low-risk')
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/migrate_20241209.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# jscpd:ignore-start
# Auto-synced file, managed by [dealroom/core-mothership](https://github.com/dealroom/core-mothership)
# The changes to this file will be automatically overwritten on the next sync. Do not edit by hand!

name: Migrate (09 December 2024)

on:
push:
branches:
- main

permissions: read-all

jobs:
# WARNING: The following job will be executed exactly 1 time (per repository).
# The workflow is automatically disabled in the last step.
# This as a sort-of global "migration" script for repositories.
migrate:
runs-on: ubuntu-latest
permissions:
# To be able to sync GHA files
actions: write
# To read the repository contents
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Delete unnecessary files and folders
run: |
rm -f ./.github/migrate_20240320.yml
rm -f ./.github/migrate_20240412.yml
rm -f ./.github/migrate_20240620.yml
- name: Create needed labels
run: |
#
# Step 1: Add new labels with descriptions
#
gh label create update-digest --force -R "$REPO_NAME" --color EDEDED --description "Pinning a digest to a dependency"
gh label create pre-release --force -R "$REPO_NAME" --color 5319E7 --description "Marks a PR as a release preview"
#
# Step 2: Delete all unused labels
#
# Note: This script cannot be inlined due to usage of IFS breaking the GHA ("Error: Process completed with exit code 1.")
#
chmod +x ./.github/scripts/delete-unused-labels/script.sh
./.github/scripts/delete-unused-labels/script.sh
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_DEALROOMBA }}
REPO_NAME: ${{ github.repository }}
- name: Create Migration PR
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
commit-message: "DEV: Repository migration"
title: "DEV: Workflow repository migration"
body: |
:robot: This is an auto-generated PR to migrate the repository.
token: ${{ secrets.GH_TOKEN_DEALROOMBA }}
branch: feature/DEV/repository-migration
delete-branch: true
labels: |
sync
force-lint
- name: Disable itself
run: |
gh workflow disable -R "$GITHUB_REPOSITORY" "${{ github.workflow }}"
env:
GH_TOKEN: ${{ github.token }}
# jscpd:ignore-end
11 changes: 11 additions & 0 deletions prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Auto-synced file, managed by dealroom/core-mothership
// The changes to this file will be automatically overwritten on the next sync. Do not edit by hand!

module.exports = {
// Overrides for specific file types
overrides: [
Expand All @@ -13,6 +16,14 @@ module.exports = {
options: {
proseWrap: 'preserve'
}
},
{
files: ['**/*.yml', '**/*.yaml'],
options: {
// This doesn't work with the current version of prettier
// @see: https://github.com/prettier/prettier/issues/16037
quoteProps: 'as-needed'
}
}
]
}

0 comments on commit a1fa53c

Please sign in to comment.