Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
versioning-strategy: increase-if-necessary
schedule:
interval: monthly
open-pull-requests-limit: 20
labels:
- dependencies
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 20
labels:
- dependencies
version: 2
updates:

- package-ecosystem: npm
directory: "/"
versioning-strategy: increase-if-necessary
schedule:
interval: monthly
open-pull-requests-limit: 20
labels:
- dependencies

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 20
labels:
- dependencies
63 changes: 63 additions & 0 deletions .github/workflows/autocommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Autoupdate code

on:
push:
branches:
- main

concurrency:
group: 'autobuild'
cancel-in-progress: true

permissions:
contents: write

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
date: ${{ steps.date.outputs.date }}
steps:
- name: Get current date
id: date
run: echo "date=$(date -u +'%Y-%m-%d %H:%M UTC')" >> $GITHUB_OUTPUT

update-and-commit:
name: ${{ matrix.name }} and Commit
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
include:
- operation: format
name: Format code
description: "Format code according to project standards"
- operation: pack
name: Update dist folder
description: "Rebuild the distribution files"
max-parallel: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.IMPRESSBOT_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run ${{ matrix.operation }}
run: npm run ${{ matrix.operation }}

- name: Commit and push if changes exist
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "${{ matrix.name }} ${{ needs.prepare.outputs.date }}"
commit_user_name: ImpressBot
commit_user_email: [email protected]
commit_author: ImpressBot <[email protected]>
38 changes: 21 additions & 17 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: Automatic releases

on:
workflow_dispatch:
schedule:
- cron: '5 4 * */3 0'

jobs:
auto-release:
runs-on: ubuntu-latest
steps:
- name: Releasing if there is something new...
uses: impresscms-dev/[email protected]
with:
release_branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
name: Automatic releases

on:
workflow_dispatch:
schedule:
- cron: '0 0 1 */6 *'

permissions:
contents: write
pull-requests: write

jobs:
auto-release:
runs-on: ubuntu-latest
steps:
- name: Releasing if there is something new...
uses: impresscms-dev/[email protected]
with:
release_branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
39 changes: 39 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Based on code from https://andre.arko.net/2022/05/15/automatic-dependabot-merges/

name: "Merge updates"
on:
workflow_run:
workflows:
- "Tests and Checks"
types:
- "completed"
branches:
- "dependabot/**"
jobs:
merge:
name: "Merge"
runs-on: "ubuntu-latest"
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' &&
github.actor == 'dependabot[bot]'
steps:
- name: "Approve pull request"
uses: "juliangruber/approve-pull-request-action@v2"
with:
github-token: "${{ secrets.IMPRESSBOT_TOKEN }}"
number: "${{ github.event.workflow_run.pull_requests[0].number }}"

- name: "Merge pull request"
uses: "actions/github-script@v7"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const pullRequest = context.payload.workflow_run.pull_requests[0]
const repository = context.repo
await github.rest.pulls.merge({
merge_method: "merge",
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
})
125 changes: 0 additions & 125 deletions .github/workflows/on-pull-request.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Tests and Checks

on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review

permissions:
contents: write
pull-requests: write

jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- task: test
name: Run tests
command: test
- task: format-check
name: Check code formatting
command: format-check
- task: lint
name: Lint code
command: lint
- task: pack
name: Compile
command: pack
fail-fast: false
name: ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'

- name: Install dependencies
run: npm install
env:
CI: true

- name: ${{ matrix.name }}
run: npm run ${{ matrix.command }}
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "flattern-markdown-folder-structure-action",
"version": "1.1.0",
"description": "GitHub action to flatten file structure with markdown data",
"main": "src/index.js",
"type": "module",
Expand All @@ -12,7 +11,7 @@
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"format": "prettier --write **/*.js tests/**/*.js",
"format-check": "prettier --check **/*.js tests/**/*.js",
"lint": "eslint src/**/*.js tests/**/*.js",
"lint": "eslint --no-warn-ignored 'src/**/*.js' 'tests/**/*.js'",
"pack": "ncc build src/index.js --minify",
"all": "npm install && npm run format && npm run lint && npm run pack",
"fast-all": "npm install && npm run pack"
Expand Down