Skip to content

Commit 9f37ae7

Browse files
Merge pull request #9 from GeorgeDavis-Ibexlabs/github-ci
Renamed GitHub Action and changed .md files
2 parents c38082f + 8900990 commit 9f37ae7

File tree

4 files changed

+120
-10
lines changed

4 files changed

+120
-10
lines changed

.github/workflows/docker-publish.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ name: Publish Docker image
1212
on:
1313
# Triggers the workflow on push or pull request events but only for the "main" branch
1414
push:
15-
branches: [ "main", "github-ci" ]
15+
branches: [ "main" ]
1616
pull_request:
17-
branches: [ "main", "github-ci" ]
17+
branches: [ "main" ]
1818

1919
jobs:
2020
push_to_registry:
@@ -40,7 +40,17 @@ jobs:
4040
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
4141
with:
4242
context: .
43-
file: ./Dockerfile
43+
file: Dockerfile
4444
push: true
4545
tags: ${{ steps.meta.outputs.tags }}
46-
labels: ${{ steps.meta.outputs.labels }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
48+
- name: Update Docker Hub description
49+
uses: peter-evans/dockerhub-description@v3
50+
with:
51+
username: ${{ secrets.DOCKERHUB_USERNAME }}
52+
password: ${{ secrets.DOCKERHUB_TOKEN }}
53+
repository: georgedavisibexlabs/publish-sarif-to-jira
54+
short-description: Publish SARIF data to JIRA
55+
readme-filepath: ./DOCKER.md
56+
enable-url-completion: true

DOCKER.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# publish-sarif-to-jira
2+
3+
Python project to push SARIF output to JIRA Cloud and track progress of personal projects in JIRA
4+
5+
Project Status: **In Active Development**
6+
7+
## Prerequisites
8+
9+
1. Requires a JIRA Cloud account
10+
- Access to the Authentication Email and API token
11+
12+
## Work items
13+
14+
1. Use rich-text (Atlassian Document Format) in JIRA Issue description
15+
16+
> **Note**: This feature is gated with the config parameter `use_atlassian_document_format` in the config.json file. Set to true to use this feature.
17+
**Bug**: Atlassian does not accept ADF rich-text formatted description, rather dumps JSON in the issue description. Needs triage and bug fix.
18+
19+
2. Create sub-tasks instead of multi-lines in the JIRA Issue description
20+
21+
> **Note**: This feature is not implemented yet and will be gated with the config parameter `create_sub_tasks` in the config.json file. Set to true to build and test this feature.
22+
23+
## Usage
24+
25+
1. Copy the `.env.example` file into `.env`
26+
2. Update the configuration values, both `input` and `jira` values on the `.env` file
27+
3. Run Docker container using
28+
`docker run --network host -itd --env-file .env publish-sarif-to-jira:main`
29+
30+
4. The Python script within the Docker container iterates through the SARIF files (files ending with `.sarif` extension or has the term `.sarif` in the filename) and creates JIRA Issues on your JIRA Cloud instance
31+
32+
> This script has not been tested with the self-hosted instances of JIRA
33+
34+
## Configuration
35+
36+
| `config.json` | Config Environment variable | Description |
37+
|---------------|-----------------------------|-------------|
38+
| `input["type"]` | `input_type` | Supported SARIF input types: `file`|
39+
| `input["format"]` | `input_format` | Supported SARIF format: `sarif` |
40+
| `jira["cloud_url"]` | `jira_cloud_url` | JIRA Cloud URL: `https://XXXX.atlassian.net/` |
41+
| `jira["project_key"]` | `jira_project_key` | JIRA Project Key: `PROJ-XYZ` |
42+
| `jira["auth_email"]` | `jira_auth_email` | Authentication Email: `test@example.com` |
43+
| `jira["api_token"]` | `jira_api_token` | API token: `<INSERT-YOUR-JIRA-CLOUD-API-TOKEN>` |
44+
| `jira["default_issue_labels"]` | `jira_default_issue_labels` | For config.json - `["Label1","Label2"]`. For config environment variables, we use comma-separated string like `Label1,Label2` |
45+
| `jira["use_atlassian_document_format"]` | `jira_use_atlassian_document_format` | Unsupported yet on JIRA Cloud. Defaults to `false`. |
46+
| `jira["create_sub_tasks"]` | `jira_create_sub_tasks` | Placeholder. Feature yet to be developed. Defaults to `false`. |
47+
48+
## Tool Compatibility
49+
50+
| Tools | Link | Status |
51+
|-------|------|--------|
52+
| `cfn-lint` | [aws-cloudformation/cfn-lint](https://github.com/aws-cloudformation/cfn-lint) ||
53+
| `trivy` | [aquasecurity/trivy](https://github.com/aquasecurity/trivy) ||
54+
55+
## GitHub Actions
56+
57+
```
58+
- name: Create JIRA tickets from SARIF
59+
uses: GeorgeDavis-Ibexlabs/publish-sarif-to-jira@v0.0.6
60+
```
61+
Refer to [Create JIRA tickets from SARIF using GitHub Actions](https://github.com/marketplace/actions/create-jira-tickets-from-sarif)
62+
63+
## Work in progress
64+
65+
- #### VSCode Extension
66+
67+
Plans to build this project into a VSCode extension to submit SARIF output to JIRA direct from the IDE and track progress
68+
69+
## Upcoming features
70+
71+
Feature requests are currently tracked by the original author within the source code. Clone this repository, run a search for the term "TODO" to find the list of new features being tracked.
72+
73+
1. Create sub-tasks instead of multi-lines in the JIRA Issue description
74+
2. Fully support Atlassian Document Format (ADF). Currently, a bug is limiting the ADF from appearing formatted when visiting the JIRA Issue on JIRA Cloud
75+
3. Create a JIRA Project if the project does not exist (Nice to have so it can be deployed per project all from CI/CD without the need to access JIRA Cloud)
76+
77+
## Contribute
78+
79+
If you encounter a bug or think of a useful feature, or find something confusing in the docs, please create a new issue.
80+
81+
I ♥️ pull requests. If you'd like to fix a bug or contribute to a feature or simply correct a typo, please feel free to do so.
82+
83+
If you're thinking of adding a new feature, consider opening an issue first to discuss it to ensure it aligns with the direction of the project and potentially save yourself some time.
84+
85+
## Development
86+
87+
```sh
88+
docker login
89+
```
90+
91+
```sh
92+
docker build --no-cache --progress=plain . -f Dockerfile -t publish-sarif-to-jira:main 2>&1 | tee build.log
93+
```
94+
95+
```sh
96+
docker run --network host -itd \
97+
--env-file .env \
98+
-e LOG_LEVEL='DEBUG' \
99+
publish-sarif-to-jira:main
100+
```

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Project Status: **In Active Development**
2525
1. Copy the `config.json.example` file into `config.json`
2626
2. Update the configuration values, both `input` and `jira` sections of the `config.json` file
2727
3. Run this Python script in a directory where the SARIF files are located
28-
4. The Python script iterates through the SARIF files (files ending with .sarif extension or has the term `.sarif` in the filename) and creates JIRA Issues on your JIRA Cloud instance
28+
4. The Python script iterates through the SARIF files (files ending with `.sarif` extension or has the term `.sarif` in the filename) and creates JIRA Issues on your JIRA Cloud instance
2929

3030
> This script has not been tested with the self-hosted instances of JIRA
3131
@@ -84,12 +84,12 @@ docker login
8484
```
8585

8686
```sh
87-
docker build --no-cache --progress=plain . -f Dockerfile -t github-sarif-to-jira:latest 2>&1 | tee build.log
87+
docker build --no-cache --progress=plain . -f Dockerfile -t publish-sarif-to-jira:main 2>&1 | tee build.log
8888
```
8989

9090
```sh
9191
docker run --network host -itd \
9292
--env-file .env \
9393
-e LOG_LEVEL='DEBUG' \
94-
github-sarif-to-jira:latest
94+
publish-sarif-to-jira:main
9595
```

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
name: 'Create JIRA tickets from SARIF'
3-
description: 'Create JIRA tickets from SARIF'
2+
name: 'Publish SARIF to JIRA'
3+
description: 'Create JIRA issues from SARIF data'
44
author: 'GeorgeDavis-Ibexlabs'
55
inputs:
66
input_type:
@@ -40,4 +40,4 @@ branding:
4040
color: 'purple'
4141
runs:
4242
using: 'docker'
43-
image: 'Dockerfile'
43+
image: 'georgedavisibexlabs/publish-sarif-to-jira:main'

0 commit comments

Comments
 (0)