Skip to content

Commit c53cda5

Browse files
authored
Bump CI actions (#73)
1 parent e60b53b commit c53cda5

File tree

8 files changed

+222
-66
lines changed

8 files changed

+222
-66
lines changed

.github/ISSUE_TEMPLATE/patch_report.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ assignees: petruki
1111
A clear and concise description of why the patch is needed.
1212

1313
**Current dependency**
14-
- **Name**:
15-
- **Version**:
14+
- **name@version**:
1615

1716
**Optional - Remediation**
18-
- **Name**:
19-
- **Version**:
17+
- **name@version**:
2018

2119
**Additional context**
2220
Links or documentation to the vulnerability or dependency update.

.github/workflows/master.yml

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,31 @@ jobs:
1414
concurrency: ci-${{ github.ref }}
1515

1616
steps:
17-
- uses: actions/checkout@v3
18-
with:
17+
- name: Git checkout
18+
uses: actions/checkout@v4
19+
with:
1920
fetch-depth: 0
2021

21-
- name: Set up Python 3.11
22-
uses: actions/setup-python@v3
23-
with:
24-
python-version: "3.11"
25-
26-
- name: Install dependencies
27-
run: pip install -r tests/requirements.txt
28-
29-
- name: Test
30-
run: pytest -v --cov=./ --cov-report xml
31-
32-
- name: Fix code coverage path
33-
working-directory: ./
34-
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
35-
36-
- name: SonarCloud Scan
37-
uses: sonarsource/sonarcloud-github-action@v2.0.2
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
22+
- name: Set up Python 3.11
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: "3.11"
26+
27+
- name: Install dependencies
28+
run: pip install -r tests/requirements.txt
29+
30+
- name: Test
31+
run: pytest -v --cov=./ --cov-report xml
32+
33+
- name: Fix code coverage path
34+
working-directory: ./
35+
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
36+
37+
- name: SonarCloud Scan
38+
uses: sonarsource/sonarcloud-github-action@v2.0.2
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4142

4243
docker:
4344
name: Publish Docker Image
@@ -50,20 +51,20 @@ jobs:
5051

5152
steps:
5253
- name: Set up QEMU
53-
uses: docker/setup-qemu-action@v2
54+
uses: docker/setup-qemu-action@v3
5455

5556
- name: Set up Docker Buildx
56-
uses: docker/setup-buildx-action@v2
57+
uses: docker/setup-buildx-action@v3
5758

5859
- name: Login to DockerHub
59-
uses: docker/login-action@v2
60+
uses: docker/login-action@v3
6061
with:
6162
username: ${{ secrets.DOCKERHUB_USERNAME }}
6263
password: ${{ secrets.DOCKERHUB_TOKEN }}
6364

6465
- name: Build and push
6566
id: docker_build
66-
uses: docker/build-push-action@v3
67+
uses: docker/build-push-action@v5
6768
with:
6869
push: true
6970
platforms: linux/amd64,linux/arm64
@@ -76,28 +77,30 @@ jobs:
7677

7778
steps:
7879
- name: Checkout
79-
uses: actions/checkout@v3
80+
uses: actions/checkout@v4
8081
with:
8182
ref: 'master'
8283

8384
- name: Checkout Kustomize
84-
uses: actions/checkout@v3
85+
uses: actions/checkout@v4
8586
with:
8687
token: ${{ secrets.ARGOCD_PAT }}
8788
repository: switcherapi/switcher-deployment
8889
ref: master
8990

90-
- name: Set Image
91-
uses: stefanprodan/kube-tools@v1
91+
- name: Set up arkade-get
92+
uses: alexellis/arkade-get@master
9293
with:
93-
kubectl: 1.24.0
94-
kustomize: 4.5.4
95-
command: |
96-
cd switcher-slack-app/base
97-
echo RELEASE_TIME=`date` > environment-properties.env
98-
kustomize edit set image trackerforce/switcher-slack-app:latest=trackerforce/switcher-slack-app@${{ needs.docker.outputs.digest }}
99-
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
100-
git config --global user.name "${{ github.actor }}"
101-
git add .
102-
git commit -m "[argocd] switcher-slack-app: ${{ needs.docker.outputs.digest }}"
103-
git push
94+
kubectl: latest
95+
kustomize: latest
96+
97+
- name: Update GitOps repository
98+
run: |
99+
cd switcher-slack-app/base
100+
echo RELEASE_TIME=`date` > environment-properties.env
101+
kustomize edit set image trackerforce/switcher-slack-app:latest=trackerforce/switcher-slack-app@${{ needs.docker.outputs.digest }}
102+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
103+
git config --global user.name "${{ github.actor }}"
104+
git add .
105+
git commit -m "[argocd] switcher-slack-app: ${{ needs.docker.outputs.digest }}"
106+
git push

.github/workflows/release.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
14-
15-
- name: Set up Python 3.11
16-
uses: actions/setup-python@v3
17-
with:
18-
python-version: "3.11"
19-
20-
- name: Install dependencies
21-
run: pip install -r tests/requirements.txt
22-
23-
- name: Test
24-
run: pytest
13+
- name: Git checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Python 3.11
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Install dependencies
24+
run: pip install -r tests/requirements.txt
25+
26+
- name: Test
27+
run: pytest
2528

2629
docker:
2730
name: Publish Docker Image
@@ -30,28 +33,28 @@ jobs:
3033

3134
steps:
3235
- name: Checkout code
33-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3437

3538
- name: Docker meta
3639
id: meta
37-
uses: docker/metadata-action@v4
40+
uses: docker/metadata-action@v5
3841
with:
3942
images: trackerforce/switcher-slack-app
4043

4144
- name: Set up QEMU
42-
uses: docker/setup-qemu-action@v2
45+
uses: docker/setup-qemu-action@v3
4346

4447
- name: Set up Docker Buildx
45-
uses: docker/setup-buildx-action@v2
48+
uses: docker/setup-buildx-action@v3
4649

4750
- name: Login to DockerHub
48-
uses: docker/login-action@v2
51+
uses: docker/login-action@v3
4952
with:
5053
username: ${{ secrets.DOCKERHUB_USERNAME }}
5154
password: ${{ secrets.DOCKERHUB_TOKEN }}
5255

5356
- name: Build and push
54-
uses: docker/build-push-action@v3
57+
uses: docker/build-push-action@v5
5558
with:
5659
context: .
5760
push: true

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [switcher.project@gmail.com](mailto:switcher.project@gmail.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: https://contributor-covenant.org
46+
[version]: https://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing to Switcher Project
2+
3+
The following is a set of guidelines for contributing to Switcher Project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
4+
5+
#### Table Of Contents
6+
7+
[Code of Conduct](#code-of-conduct)
8+
9+
[How Can I Contribute?](#how-can-i-contribute)
10+
* [Reporting Bugs](#reporting-bugs)
11+
* [Suggesting Enhancements](#suggesting-enhancements)
12+
* [Your First Code Contribution](#your-first-code-contribution)
13+
* [Pull Requests](#pull-requests)
14+
15+
## Code of Conduct
16+
17+
This project and everyone participating in it is governed by the [Switcher Project Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [switcher.project@gmail.com](mailto:switcher.project@gmail.com).
18+
19+
You can join the Switcher-HQ Slack team:
20+
21+
* [Join the Slack Team](https://switcher-hq.slack.com/)
22+
* Even though Slack is a chat service, sometimes it takes several hours for community members to respond — please be patient!
23+
* Use the `#random` channel for general questions or discussion about Switcher Project
24+
25+
## How Can I Contribute?
26+
27+
### Reporting Bugs
28+
29+
This section guides you through submitting a bug report. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
30+
31+
1. Use the GitHub issue search — check if the issue has already been reported.
32+
2. Check if the issue has been fixed — try to reproduce it using the latest master or development branch in the repository.
33+
34+
Example:
35+
36+
> Short and descriptive example bug report title
37+
>
38+
> A summary of the issue. If suitable, include the steps required to reproduce the bug.
39+
>
40+
> 1. This is the first step
41+
> 2. This is the second step
42+
> 3. Further steps, etc.
43+
>
44+
> Any other information you want to share that is relevant to the issue being
45+
> reported. This might include the lines of code that you have identified as
46+
> causing the bug, and potential solutions (and your opinions on their
47+
> merits).
48+
49+
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
50+
51+
### Suggesting Enhancements
52+
53+
This section guides you through submitting an enhancement suggestion for Switcher Project, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
54+
55+
Simply create an issue and provide the following information:
56+
57+
* **Use a clear and descriptive title** for the issue to identify the suggestion.
58+
* **Provide a step-by-step description of the suggested enhancement** in as much detail as possible. This additional context helps the maintainers to understand the enhancement from your perspective
59+
* **Explain why this enhancement would be useful**
60+
61+
### Your First Code Contribution
62+
63+
Unsure where to begin contributing to Switcher? You can start by looking through these `minor-issue` and `bug` issues:
64+
65+
* Minor issue - issues which should only require a few lines of code, and a test or two.
66+
* Bug - issues which should be a bit more involved than `minor` issues.
67+
68+
### Pull Requests
69+
70+
The process described here has several goals:
71+
72+
- Maintain Switcher's Project quality
73+
- Fix problems that are important to users
74+
- Engage the community in working toward the best possible Switcher
75+
- Enable a sustainable system for Switcher's maintainers to review contributions
76+
77+
Please follow these steps to have your contribution considered by the maintainers:
78+
79+
1. Fork the repository
80+
2. Clone the repository
81+
3. Create a branch
82+
4. Make necessary changes and commit those changes
83+
5. Push changes to GitHub
84+
6. Submit your changes for review
85+
7. Keeping your fork synced with this repository

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023-present Roger Floriano (petruki) and Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ A summary message containing all details about the change will be sent to a spec
4545
## Requirements
4646
- Python 3.11
4747
- VirtualEnv
48-
- Ngrok
48+
- Ngrok (Slack Apps requires HTTPS endpoint)
4949

5050
## Create Slack App
5151

@@ -71,7 +71,7 @@ Assuming that you have signed up for a Slack account and are logged in to a Work
7171
4. Create a .env file based on .env.template and paste the copied values.
7272
5. Make sure that the SWITCHER_JWT_SECRET matches the Switcher API env value for SWITCHER_SLACK_JWT_SECRET
7373
6. Make sure that Switcher Management has SWITCHERSLACKAPP_URL set to the app URL
74-
7. Start the API by running: py .\src\app.py
74+
7. Start the API by running: `python src\app.py`
7575

7676
## Contributing
7777

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version: '3.8'
1111

1212
services:
1313
switcherslackapp:
14-
image: trackerforce/switcher-slack-app
14+
image: trackerforce/switcher-slack-app:latest
1515
container_name: switcherslackapp
1616
command: gunicorn --bind 0.0.0.0:5000 --chdir /home/app app:flask_app
1717
# TLS Enabled

0 commit comments

Comments
 (0)