Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
eed56ce
Prepare for initial release
rtfpessoa Nov 6, 2017
56c02f8
Merge pull request #2 from codacy/initial-release
rtfpessoa Nov 6, 2017
71b780f
Testing
rtfpessoa Nov 6, 2017
895ed75
attempt to fix build
fnxpt Mar 20, 2018
fd9361b
fix explicit_type_interface file
fnxpt Mar 20, 2018
6934c66
Merge branch 'master' into fix/build
fnxpt Mar 20, 2018
86ec3cc
update tool version
fnxpt Mar 20, 2018
d9c6cf2
add missing rules
fnxpt Mar 20, 2018
db33499
Merge pull request #3 from fnxpt/fix/build
rtfpessoa May 14, 2018
fe36bd6
Debian base image with jre and swiftlint
mrfyda Oct 2, 2018
c0f6636
circle 2 config
mrfyda Oct 2, 2018
a0a11de
Update seed version
mrfyda Oct 5, 2018
730b07d
Use slim base image
mrfyda Oct 5, 2018
e32803f
Merge pull request #4 from mrfyda/master
rtfpessoa Oct 8, 2018
ecb5b0a
Update and rename circle.yml to .circleci/config.yml
rtfpessoa Oct 8, 2018
85dcf2f
Update config.yml
Oct 8, 2018
27562b1
Merge pull request #5 from codacy/rtfpessoa-patch-1
rtfpessoa Oct 9, 2018
ad3f262
Fix running with multiple files
Oct 18, 2018
0c87ec4
Merge pull request #6 from codacy/fix-running-multiple-files
rtfpessoa Oct 19, 2018
346bb75
Update docs about contributing your own tool
IGFCoimbra Oct 30, 2018
e9bfd4c
Merge pull request #7 from codacy/IGFCoimbra-patch-1
rtfpessoa Oct 31, 2018
5ba128b
Add CODEOWNERS
lolgab Sep 30, 2019
13fa82f
Merge pull request #8 from codacy/add-codeowners
lolgab Oct 1, 2019
1399cf9
feature: Update SwiftLint to 0.36.0
lolgab Nov 6, 2019
f653941
fix: Use directly swiftlint image since no compatible with openjdk image
lolgab Nov 7, 2019
3e17aad
Merge pull request #9 from codacy/update-swiftlint-0.36.0
lolgab Nov 7, 2019
92493a7
bump: Bump codacy orbs
lolgab Dec 26, 2019
7af8d22
Merge pull request #11 from codacy/bump-orbs
lolgab Dec 26, 2019
3ea636a
bump: Bump circleci orbs version
josemiguelmelo Jan 13, 2020
885bb03
Merge pull request #12 from codacy/jose-melo/bump/circleci-orbs
josemiguelmelo Jan 13, 2020
de48ecc
fix: Use specified configuration even when native is present on src f…
josemiguelmelo Jan 13, 2020
665ca70
Merge pull request #13 from codacy/jose-melo/fix/override-native-config
josemiguelmelo Jan 13, 2020
9b1a4df
test: Multiple tests added to tool
josemiguelmelo Jan 13, 2020
ca7dc6a
fix: Fix tests to not use native configuration
josemiguelmelo Jan 13, 2020
57aca84
Add run multiple tests to circleci
josemiguelmelo Jan 14, 2020
a51d2df
fix: Fix problem with running the tool for multiple files and custom …
josemiguelmelo Jan 14, 2020
3904da7
Merge pull request #14 from codacy/jose-melo/test/multiple-tests
josemiguelmelo Jan 14, 2020
4e6e515
bump: Bump codacy engine scala seed to 4.0.0
josemiguelmelo Mar 3, 2020
70b5f83
Merge pull request #15 from codacy/bump/codacy-engine
josemiguelmelo Mar 3, 2020
77a2abc
fix: Fix Codacy badge link
Mar 13, 2020
146f63d
Merge pull request #17 from codacy/fix-badge
Mar 13, 2020
fe7d96f
fix: Change tool to only analyse files passed as input (#18)
May 20, 2020
aaf4df2
test: Add test to filter files
lolgab Jun 5, 2020
b86575a
clean: Update CODEOWNERS
lolgab Jun 5, 2020
333509b
Merge pull request #22 from codacy/codeowners
lolgab Jun 7, 2020
11675e1
Merge pull request #21 from codacy/update-codacy-plugins-test
lolgab Jun 8, 2020
3d2be9d
fix: Replace patterns.json name with short name :breaking: (#23)
Jul 17, 2020
6cf77bd
feature: Update Swiftlint and use native-image
lolgab Jul 20, 2020
22cfc61
fix: Create smaller docker image
lolgab Jul 21, 2020
9cdffcd
fix: Fix Dockerfile.dev
lolgab Jul 21, 2020
94b9dbe
docs: Document Dockerfile.dev
lolgab Jul 21, 2020
8caef80
feature: Add generated docs
lolgab Jul 22, 2020
890dede
Merge pull request #24 from codacy/feature-use-native-image
lolgab Jul 22, 2020
1827202
feature: Add/update GitHub actions to handle Jira tickets
machadoit Aug 4, 2020
694d85d
Merge pull request #25 from codacy/meta/update-jira-github-actions
machadoit Aug 5, 2020
7e446d4
meta: No longer runs failing worflows for comments on pull requests
machadoit Aug 6, 2020
6edbb17
Merge pull request #26 from codacy/meta/update-jira-actions-2020-08-6…
machadoit Aug 7, 2020
5a868ca
bump: Bump swiftlint to 0.40.0 version
Aug 13, 2020
2913513
Merge pull request #27 from codacy/bump/swiftlint-0.40
Aug 13, 2020
c26706a
feature: Add enabled by default to patterns.json
josemiguelmelo Sep 15, 2020
955238f
Merge pull request #28 from codacy/enabled-by-default
josemiguelmelo Sep 15, 2020
2dd5886
Bump codacy-seed
machadoit Sep 18, 2020
3e521e3
Merge pull request #29 from codacy/bump-seed
machadoit Sep 18, 2020
b2c1ba8
meta: Bump gajira-comment and gajira-create on Github workflow
josemiguelmelo Oct 28, 2020
157ad87
Merge pull request #31 from codacy/bump-gajira
Oct 28, 2020
fd899e9
fix: Timeout and other setting are not read at runtime
lolgab Mar 29, 2021
4c93578
Merge pull request #32 from codacy/remove-initialize-at-build-time
lolgab Mar 29, 2021
ea98190
feature: Add documentation generator
lolgab Mar 30, 2021
23d26c1
test: Fix tests to align with the new severity levels
lolgab Mar 31, 2021
234fefc
Merge pull request #33 from codacy/add-doc-generator
lolgab Mar 31, 2021
41a5163
bump: Bump circleci plugins test orb CY-4462
josemiguelmelo Jun 8, 2021
4472044
Merge pull request #34 from codacy/bump-test-orb
lolgab Jun 8, 2021
0c73909
bump: Update base image CY-5141
machadoit Oct 20, 2021
f98ca4c
fix: Update tests to new output and delete some tests
lolgab Oct 27, 2021
a22dfbe
fix: Invalidate CircleCI cache
lolgab Oct 27, 2021
b2d3b7d
Delete failing tests and invalidate cache
lolgab Oct 27, 2021
bdaa765
Merge pull request #35 from codacy/bump/update-base-image-CY-5141
lolgab Oct 27, 2021
372d230
update tree docs
Jun 29, 2022
5d89f02
Usage default config file usage behavior of swiftlint (don't specify …
rubencodacy Jul 6, 2022
ec3fa74
bump: ci codacy@base
rubencodacy Jul 6, 2022
23a5d51
update the circle orb version
Jul 6, 2022
20b38d1
Fix multiple-tests
rubencodacy Jul 6, 2022
e9c48a8
update the codacy test orb since it's segfaulting
Jul 6, 2022
c9fc94b
Merge pull request #37 from codacy/sync-published-docs-to-code
rubencodacy Jul 6, 2022
ddcfe0c
Merge branch 'master' into fix-CY-6272
rubencodacy Jul 6, 2022
f790fb8
Merge pull request #39 from codacy/fix-CY-6272
pedrocodacy Jul 6, 2022
580fe05
feature: Update swiftlint to last version 0.50.1
lolgab Nov 29, 2022
da6fa1a
fix: Update base image
lolgab Nov 29, 2022
459c964
Update to scala-cli and fix scalafmt checks
lolgab Jan 4, 2023
90e73f6
bump: Update codacy-sbt-plugin
lolgab Jan 4, 2023
e0550e4
Migrate doc-generator to sbt
lolgab Jan 4, 2023
1ca1ef4
Update build to use steps
lolgab Jan 4, 2023
ec7fc0c
fix: Fix build
lolgab Jan 4, 2023
989bc26
bump: Codacy orbs
lolgab Jan 4, 2023
75c6a55
Avoid sbt_docker
lolgab Jan 4, 2023
33bc474
Use headless jre in dev Dockerfile
lolgab Jan 4, 2023
e3c5d0b
Use main docker image
lolgab Jan 4, 2023
323464e
Add logging to doc-generator
lolgab Jan 4, 2023
0c71730
fix: Enable JavaAppPackaging plugin
lolgab Jan 5, 2023
0758b4f
Run doc-generator
lolgab Jan 5, 2023
00f77a0
Change CI to use staged doc-generator
lolgab Jan 5, 2023
3c13f49
Use swiftlint image in doc-generator
lolgab Jan 5, 2023
23de83d
Change docker command
lolgab Jan 5, 2023
f195a5d
run docker without root
lolgab Jan 5, 2023
c00bd7c
Update Swiftlint to 0.50.3
lolgab Jan 5, 2023
a1ab0ec
Disable doc-generator in CI
lolgab Jan 5, 2023
82731e9
Update README on how to update docs
lolgab Jan 5, 2023
9867135
fix: Fix doc generation
lolgab Jan 5, 2023
c5ad839
Update doc-generator to run inside docker
lolgab Jan 9, 2023
e3e6970
Use sbt_docker CircleCI job
lolgab Jan 9, 2023
a986fba
build DEV tool
lolgab Jan 9, 2023
c4d37d9
Migrate to sbt-native-image
lolgab Jan 9, 2023
c971d9f
clean circle cache
lolgab Jan 9, 2023
2fd5239
Add again JavaAppPackaging
lolgab Jan 9, 2023
593f0d5
Update docs from Docekr
lolgab Jan 9, 2023
fb79e32
Update README
lolgab Jan 9, 2023
af47982
Update path native-image
lolgab Jan 9, 2023
d3ea318
Tweak native-image flags
lolgab Jan 10, 2023
6089ca0
clean: Remove old tests
lolgab Jan 10, 2023
a32360c
Merge pull request #41 from codacy/update-swiftlint-0.50.1
lolgab Jan 10, 2023
ab3ab8e
bump: Bump swift base image
lolgab Jan 10, 2023
a59fa41
Merge pull request #43 from codacy/bump-swift
lolgab Jan 10, 2023
8eae998
doc: Update tool description
nicklem Mar 13, 2023
2005585
Merge pull request #44 from codacy/doc/update-tool-description-DOCS-372
Mar 14, 2023
22ff380
Bump to version 0.52.4 TS-573
stefanvacareanu7 Sep 20, 2023
285e1ab
Fix tests part 1
stefanvacareanu7 Sep 20, 2023
fe835b0
Bump to v0.53.0
stefanvacareanu7 Oct 10, 2023
3e17056
Bump to 0.54.0
stefanvacareanu7 Nov 22, 2023
176ba84
change swiftlint base image
mrfyda Dec 7, 2023
9a5e504
fix fallthrough test and config file key
mrfyda Dec 7, 2023
6424761
fix: docgenerator severity parse
mrfyda Dec 7, 2023
e161686
fix: doc generator severity
mrfyda Dec 7, 2023
9dddfe6
fix: tests
codacy-vrhpires Dec 9, 2023
0c886cf
fix: tests
codacy-vrhpires Dec 9, 2023
977370b
fix: tests
codacy-vrhpires Dec 9, 2023
cf3e847
fix: tests
codacy-vrhpires Dec 9, 2023
a9b17e1
fix: tests
codacy-vrhpires Dec 9, 2023
07c7a3a
fix: revert plugins-test
codacy-vrhpires Dec 9, 2023
0357e62
fix: tests
codacy-vrhpires Dec 9, 2023
91018be
fix: tests
codacy-vrhpires Dec 9, 2023
e7f05ed
bump: plugins-test
codacy-vrhpires Dec 9, 2023
b3c7076
revert: plugins-test; update rule;
codacy-vrhpires Dec 11, 2023
1bfffbc
Merge pull request #45 from codacy/bump_to_v0.52.4
codacy-vrhpires Dec 12, 2023
e4db7dd
Fix vulnerabilities TCE-788 (#46)
stefanvacareanu7 Jan 30, 2024
7dd49c8
TCE-927 Fix vulnerabilities (#48)
DMarinhoCodacy May 7, 2024
8b3cc3c
Bump to 0.55.1 TCE-1044 (#49)
stefanvacareanu7 Aug 5, 2024
4e5fbd7
update/version_0.57.0 (#50)
stefanvacareanu7 Oct 22, 2024
722c6bb
bump swiftlint 0.58.2 (#51)
DMarinhoCodacy Mar 28, 2025
6af4027
TCE-1312 Bump Swiftlint 0.59.1
DMarinhoCodacy Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
60 changes: 60 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: 2.1

orbs:
codacy: codacy/[email protected]
codacy_plugins_test: codacy/[email protected]

workflows:
compile_test_deploy:
jobs:
- codacy/checkout_and_version:
write_sbt_version: true
- codacy/sbt_docker:
name: publish_docker_local
steps:
- run:
name: Check Scalafmt on sources
command: sbt scalafmtCheckAll
- run:
name: Check Scalafmt on Sbt sources
command: sbt scalafmtSbtCheck
- run:
name: Build DEV java tool
command: sbt stage
- run:
name: Build Documentation generator
command: sbt doc-generator/stage
- run:
name: Build DEV image (runs doc-generator)
command: docker build -t codacy-swiftlint-dev -f Dockerfile.dev .
- run:
name: Build Graalvm native-image
command: sbt nativeImage
- run:
name: Build release Docker image
command: docker build -t $CIRCLE_PROJECT_REPONAME:latest .
- run:
name: Save Docker image to workspace
command: docker save --output docker-image.tar $CIRCLE_PROJECT_REPONAME:latest
persist_to_workspace: true
cache_prefix: sbt-cache-09012023
requires:
- codacy/checkout_and_version
- codacy_plugins_test/run:
name: plugins_test
run_multiple_tests: true
requires:
- publish_docker_local
- codacy/publish_docker:
context: CodacyDocker
requires:
- plugins_test
filters:
branches:
only:
- master
- codacy/tag_version:
name: tag_version
context: CodacyAWS
requires:
- codacy/publish_docker
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore everything
**

# Allow files and directories
!target/native-image/codacy-swiftlint
!/target/universal/stage/
!/doc-generator/target/universal/stage/
!/docs

# Ignore unnecessary files inside allowed directories
# This should go after the allowed directories
**/.DS_Store
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @codacy/toss
97 changes: 97 additions & 0 deletions .github/workflows/comment_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Comment issue on Jira

on:
issue_comment:
types: [created]

jobs:
jira:
env:
JIRA_CREATE_COMMENT_AUTO: ${{ secrets.JIRA_CREATE_COMMENT_AUTO }}
runs-on: ubuntu-latest
steps:

- name: Start workflow if JIRA_CREATE_COMMENT_AUTO is enabled
if: env.JIRA_CREATE_COMMENT_AUTO == 'true'
run: echo "Starting workflow"

- name: Check GitHub Issue type
if: env.JIRA_CREATE_COMMENT_AUTO == 'true'
id: github_issue_type
uses: actions/[email protected]
with:
result-encoding: string
script: |
// An Issue can be a pull request, you can identify pull requests by the pull_request key
const pullRequest = ${{ toJson(github.event.issue.pull_request) }}
if(pullRequest) {
return "pull-request"
} else {
return "issue"
}

- name: Check if GitHub Issue has JIRA_ISSUE_LABEL
if: env.JIRA_CREATE_COMMENT_AUTO == 'true'
id: github_issue_has_jira_issue_label
uses: actions/[email protected]
env:
JIRA_ISSUE_LABEL: ${{ secrets.JIRA_ISSUE_LABEL }}
with:
result-encoding: string
script: |
const labels = ${{ toJson(github.event.issue.labels) }}
if(labels.find(label => label.name == process.env.JIRA_ISSUE_LABEL)) {
return "true"
} else {
return "false"
}

- name: Continue workflow only for Issues (not Pull Requests) tagged with JIRA_ISSUE_LABEL
if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true'
env:
GITHUB_ISSUE_TYPE: ${{ steps.github_issue_type.outputs.result }}
GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL: ${{ steps.github_issue_has_jira_issue_label.outputs.result }}
run: echo "GitHub Issue is tracked on Jira, eligilbe to be commented"

- name: Jira Login
if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true'
id: login
uses: atlassian/[email protected]
env:
GITHUB_ISSUE_TYPE: ${{ steps.github_issue_type.outputs.result }}
GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL: ${{ steps.github_issue_has_jira_issue_label.outputs.result }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Extract Jira number
if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true'
id: extract_jira_number
uses: actions/[email protected]
env:
GITHUB_ISSUE_TYPE: ${{ steps.github_issue_type.outputs.result }}
GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL: ${{ steps.github_issue_has_jira_issue_label.outputs.result }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
GITHUB_TITLE: ${{ github.event.issue.title }}
with:
script: |
const jiraTaskRegex = new RegExp(`\\\[(${process.env.JIRA_PROJECT}-[0-9]+?)\\\]`)
return process.env.GITHUB_TITLE.match(jiraTaskRegex)[1]
result-encoding: string

- name: Jira Add comment on issue
if: env.JIRA_CREATE_COMMENT_AUTO == 'true' && env.GITHUB_ISSUE_TYPE == 'issue' && env.GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL == 'true'
id: add_comment_jira_issue
uses: atlassian/[email protected]
env:
GITHUB_ISSUE_TYPE: ${{ steps.github_issue_type.outputs.result }}
GITHUB_ISSUE_HAS_JIRA_ISSUE_LABEL: ${{ steps.github_issue_has_jira_issue_label.outputs.result }}
with:
issue: ${{ steps.extract_jira_number.outputs.result }}
comment: |
GitHub Comment : ${{ github.event.comment.user.login }}
{quote}${{ github.event.comment.body }}{quote}
----
{panel}
_[Github permalink |${{ github.event.comment.html_url }}]_
{panel}
90 changes: 90 additions & 0 deletions .github/workflows/create_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Create issue on Jira

on:
issues:
types: [opened]

jobs:
jira:
env:
JIRA_CREATE_ISSUE_AUTO: ${{ secrets.JIRA_CREATE_ISSUE_AUTO }}
runs-on: ubuntu-latest
steps:

- name: Start workflow if JIRA_CREATE_ISSUE_AUTO is enabled
if: env.JIRA_CREATE_ISSUE_AUTO == 'true'
run: echo "Starting workflow"

- name: Jira Login
if: env.JIRA_CREATE_ISSUE_AUTO == 'true'
id: login
uses: atlassian/[email protected]
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Jira Create issue
if: env.JIRA_CREATE_ISSUE_AUTO == 'true'
id: create_jira_issue
uses: atlassian/[email protected]
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
summary: "[GH#${{ github.event.issue.number }}] ${{ github.event.issue.title }}"
description: |
${{ github.event.issue.body }}
----
{panel}
_[Github permalink |${{ github.event.issue.html_url }}]_
{panel}

- name: Update Jira issue if JIRA_UPDATE_ISSUE_BODY is defined
if: env.JIRA_CREATE_ISSUE_AUTO == 'true' && env.JIRA_UPDATE_ISSUE_BODY != ''
env:
JIRA_UPDATE_ISSUE_BODY: ${{ secrets.JIRA_UPDATE_ISSUE_BODY }}
run: >
curl
-u ${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}
-X PUT
-H 'Content-Type: application/json'
-d '${{ env.JIRA_UPDATE_ISSUE_BODY }}'
${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/${{ steps.create_jira_issue.outputs.issue }}

- name: Update GitHub issue
if: env.JIRA_CREATE_ISSUE_AUTO == 'true'
uses: actions/[email protected]
env:
JIRA_ISSUE_NUMBER: ${{ steps.create_jira_issue.outputs.issue }}
GITHUB_ORIGINAL_TITLE: ${{ github.event.issue.title }}
JIRA_ISSUE_LABEL: ${{ secrets.JIRA_ISSUE_LABEL }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const newTitle = `[${process.env.JIRA_ISSUE_NUMBER}] ${process.env.GITHUB_ORIGINAL_TITLE}`
github.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
title: newTitle
})
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [process.env.JIRA_ISSUE_LABEL]
})


- name: Add comment after sync
if: env.JIRA_CREATE_ISSUE_AUTO == 'true'
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Internal ticket created : [${{ steps.create_jira_issue.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create_jira_issue.outputs.issue }})'
})
82 changes: 82 additions & 0 deletions .github/workflows/create_issue_on_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Create issue on Jira when labeled with JIRA_ISSUE_LABEL

on:
issues:
types: [labeled]

jobs:
jira:
env:
JIRA_ISSUE_LABEL: ${{ secrets.JIRA_ISSUE_LABEL }}
runs-on: ubuntu-latest
steps:

- name: Start workflow if GitHub issue is tagged with JIRA_ISSUE_LABEL
if: github.event.label.name == env.JIRA_ISSUE_LABEL
run: echo "Starting workflow"

- name: Jira Login
if: github.event.label.name == env.JIRA_ISSUE_LABEL
id: login
uses: atlassian/[email protected]
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Jira Create issue
if: github.event.label.name == env.JIRA_ISSUE_LABEL
id: create_jira_issue
uses: atlassian/[email protected]
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
summary: "[GH#${{ github.event.issue.number }}] ${{ github.event.issue.title }}"
description: |
${{ github.event.issue.body }}
----
{panel}
_[Github permalink |${{ github.event.issue.html_url }}]_
{panel}

- name: Update Jira issue if JIRA_UPDATE_ISSUE_BODY is defined
if: github.event.label.name == env.JIRA_ISSUE_LABEL && env.JIRA_UPDATE_ISSUE_BODY != ''
env:
JIRA_UPDATE_ISSUE_BODY: ${{ secrets.JIRA_UPDATE_ISSUE_BODY }}
run: >
curl
-u ${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}
-X PUT
-H 'Content-Type: application/json'
-d '${{ env.JIRA_UPDATE_ISSUE_BODY }}'
${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/${{ steps.create_jira_issue.outputs.issue }}

- name: Change Title
if: github.event.label.name == env.JIRA_ISSUE_LABEL
uses: actions/[email protected]
env:
JIRA_ISSUE_NUMBER: ${{ steps.create_jira_issue.outputs.issue }}
GITHUB_ORIGINAL_TITLE: ${{ github.event.issue.title }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const newTitle = `[${process.env.JIRA_ISSUE_NUMBER}] ${process.env.GITHUB_ORIGINAL_TITLE}`
github.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
title: newTitle
})

- name: Add comment after sync
if: github.event.label.name == env.JIRA_ISSUE_LABEL
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Internal ticket created : [${{ steps.create_jira_issue.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create_jira_issue.outputs.issue }})'
})
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/RUNNING_PID
/logs/
/project/*-shim.sbt
/project/project/
/project/target/
/target/
target
.idea
.DS_Store
.metals
.bloop
.vscode
.bsp
metals.sbt

#Ignore vscode AI rules
.github/copilot-instructions.md
24 changes: 24 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version = "1.5.1"
style = IntelliJ

align = none
assumeStandardLibraryStripMargin = false
binPack.literalArgumentLists = true
binPack.parentConstructors = false
continuationIndent.defnSite = 4
danglingParentheses = true
docstrings = ScalaDoc
includeCurlyBraceInSelectChains = true
lineEndings = unix
maxColumn = 120
newlines.alwaysBeforeTopLevelStatements = true
newlines.penalizeSingleSelectMultiArgList = false
newlines.sometimesBeforeColonInMethodReturnType = true
optIn.breakChainOnFirstMethodDot = true
project.git = true
rewrite.rules = [ SortImports, PreferCurlyFors ]
spaces.afterKeywordBeforeParen = true

project.includeFilters = [".*\\.sbt$", ".*\\.scala$"]
project.excludeFilters = [".*\\.scala.html$", "target/.*", "modules/admin/target/.*"]
onTestFailure = "To fix this, run `scalafmt` within sbt or `sbt scalafmt` on the project base directory"
Loading