From 6dabffa799ff896d2ada427375efdfd055c5dfe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20H=C3=A4berle?= Date: Thu, 12 Nov 2020 14:46:46 +0100 Subject: [PATCH 1/5] Some change in the branch --- some-change | 1 + 1 file changed, 1 insertion(+) create mode 100644 some-change diff --git a/some-change b/some-change new file mode 100644 index 00000000..d9bf763d --- /dev/null +++ b/some-change @@ -0,0 +1 @@ +some-change From da3a8a14628136d4147c52d7f4cd66cac9e724be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20H=C3=A4berle?= Date: Thu, 12 Nov 2020 14:52:53 +0100 Subject: [PATCH 2/5] continue --- .github/workflows/lint-pr-title.yml | 74 ++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml index c69d15d7..61f9cbce 100644 --- a/.github/workflows/lint-pr-title.yml +++ b/.github/workflows/lint-pr-title.yml @@ -10,7 +10,7 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + # - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 @@ -18,4 +18,74 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - config: some config \ No newline at end of file + config: + rules: + body-leading-blank: + - 1 + - always + body-max-line-length: + - 2 + - always + - 120 + footer-leading-blank: + - 1 + - always + footer-max-line-length: + - 2 + - always + - 120 + header-max-length: + - 2 + - always + - 120 + references-empty: + - 1 + - never + scope-case: + - 2 + - always + - lower-case + subject-empty: + - 2 + - never + subject-full-stop: + - 2 + - never + - "." + type-case: + - 2 + - always + - lower-case + type-empty: + - 2 + - never + type-enum: + - 2 + - always + - - build + - ci + - chore + - docs + - feat + - fix + - perf + - infra + - refactor + - revert + - style + - test + parserPreset: + parserOpts: + referenceActions: + issuePrefixesCaseSensitive: true + issuePrefixes: + - ADATA- + - CONTENT- + - OSINSPIRE- + - MINT- + - OSACCNT- + - PWAC- + - SAB- + - WTF- + - XCCWS- + \ No newline at end of file From ab2404698f921a1d56764a137baabb2b7d9e6834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20H=C3=A4berle?= Date: Thu, 12 Nov 2020 15:07:36 +0100 Subject: [PATCH 3/5] experiment --- .github/workflows/commitlint.config | 89 +++++++++++++++++++++++++++++ .github/workflows/lint-pr-title.yml | 74 +----------------------- src/index.js | 8 ++- 3 files changed, 96 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/commitlint.config diff --git a/.github/workflows/commitlint.config b/.github/workflows/commitlint.config new file mode 100644 index 00000000..c578b207 --- /dev/null +++ b/.github/workflows/commitlint.config @@ -0,0 +1,89 @@ +{ + "rules":{ + "body-leading-blank":[ + 1, + "always" + ], + "body-max-line-length":[ + 2, + "always", + 120 + ], + "footer-leading-blank":[ + 1, + "always" + ], + "footer-max-line-length":[ + 2, + "always", + 120 + ], + "header-max-length":[ + 2, + "always", + 120 + ], + "references-empty":[ + 1, + "never" + ], + "scope-case":[ + 2, + "always", + "lower-case" + ], + "subject-empty":[ + 2, + "never" + ], + "subject-full-stop":[ + 2, + "never", + "." + ], + "type-case":[ + 2, + "always", + "lower-case" + ], + "type-empty":[ + 2, + "never" + ], + "type-enum":[ + 2, + "always", + [ + "build", + "ci", + "chore", + "docs", + "feat", + "fix", + "perf", + "infra", + "refactor", + "revert", + "style", + "test" + ] + ] + }, + "parserPreset":{ + "parserOpts":{ + "referenceActions":null, + "issuePrefixesCaseSensitive":true, + "issuePrefixes":[ + "ADATA-", + "CONTENT-", + "OSINSPIRE-", + "MINT-", + "OSACCNT-", + "PWAC-", + "SAB-", + "WTF-", + "XCCWS-" + ] + } + } +} \ No newline at end of file diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml index 61f9cbce..44e9e059 100644 --- a/.github/workflows/lint-pr-title.yml +++ b/.github/workflows/lint-pr-title.yml @@ -16,76 +16,4 @@ jobs: node-version: 12 - uses: ./ env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - config: - rules: - body-leading-blank: - - 1 - - always - body-max-line-length: - - 2 - - always - - 120 - footer-leading-blank: - - 1 - - always - footer-max-line-length: - - 2 - - always - - 120 - header-max-length: - - 2 - - always - - 120 - references-empty: - - 1 - - never - scope-case: - - 2 - - always - - lower-case - subject-empty: - - 2 - - never - subject-full-stop: - - 2 - - never - - "." - type-case: - - 2 - - always - - lower-case - type-empty: - - 2 - - never - type-enum: - - 2 - - always - - - build - - ci - - chore - - docs - - feat - - fix - - perf - - infra - - refactor - - revert - - style - - test - parserPreset: - parserOpts: - referenceActions: - issuePrefixesCaseSensitive: true - issuePrefixes: - - ADATA- - - CONTENT- - - OSINSPIRE- - - MINT- - - OSACCNT- - - PWAC- - - SAB- - - WTF- - - XCCWS- - \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/src/index.js b/src/index.js index c10b947a..00a1c13a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +const fs = require('fs'); const core = require('@actions/core'); const github = require('@actions/github'); const validatePrTitle = require('./validatePrTitle'); @@ -6,9 +7,12 @@ module.exports = async function run() { try { const client = new github.GitHub(process.env.GITHUB_TOKEN); - const config = process.env.INPUT_CONFIG; + // const config = process.env.INPUT_CONFIG; - core.info(`config ${config}`); + // core.info(`config ${config}`); + + const commitlint = fs.readFileSync('./commitlint.config'); + core.info(`commitlint ${commitlint}`); const contextPullRequest = github.context.payload.pull_request; if (!contextPullRequest) { From 125ba6a0164417bcc578ed3a880e44f5950cd66d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20H=C3=A4berle?= Date: Thu, 12 Nov 2020 15:09:15 +0100 Subject: [PATCH 4/5] experiment --- .github/workflows/lint-pr-title.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml index 44e9e059..bb83b0cd 100644 --- a/.github/workflows/lint-pr-title.yml +++ b/.github/workflows/lint-pr-title.yml @@ -10,7 +10,7 @@ jobs: main: runs-on: ubuntu-latest steps: - # - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 From e2596ef9900d76b79bf9f69d8ae9df86564a5e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20H=C3=A4berle?= Date: Thu, 12 Nov 2020 15:15:05 +0100 Subject: [PATCH 5/5] fsdf --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 00a1c13a..53dc134e 100644 --- a/src/index.js +++ b/src/index.js @@ -11,8 +11,8 @@ module.exports = async function run() { // core.info(`config ${config}`); - const commitlint = fs.readFileSync('./commitlint.config'); - core.info(`commitlint ${commitlint}`); + // const commitlint = fs.readFileSync('./commitlint.config'); + core.info(`info: ${JSON.stringify(fs.readdirSync('.'))}`); const contextPullRequest = github.context.payload.pull_request; if (!contextPullRequest) {