Skip to content

Commit

Permalink
Merge pull request #8 from zMynxx/feature/gha
Browse files Browse the repository at this point in the history
Feature/gha
  • Loading branch information
zMynxx committed Aug 18, 2023
2 parents b69203e + 3f5541c commit c3d9f12
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test
on:
workflow_dispatch:
push:

jobs:
check:
name: check pr status
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: jenseng/dynamic-uses@v1
with:
# now you can use expressions 🥳
# uses: ${{ vars.ORG_NAME }}/${{ vars.REPO_NAME }}/.github/actions/git/check-merge@${{ vars.REF}}
uses: ${{ format('{0}/{1}/.github/actions/git/check-merge@{2}', vars.ORG_NAME, vars.REPO_NAME, vars.REF) }}
# # the `with` needs to be converted to a valid json string
# with: '{ "node-version": 18 }'

# - name: check if PR is merged
# uses: ${{ vars.ORG_NAME }}/${{ vars.REPO_NAME }}/.github/actions/git/check-merge@${{ vars.REF}}

# - name: Call another action
# uses: ${{ vars.ORG_NAME }}/${{ vars.REPO_NAME }}/.github/actions/python/pytest@feature/gha
# with:
# requirements_file: ./poc/pytest/requirements.txt
# check2:
# name: Call reusable workflow
# uses: ${{ vars.ORG_NAME }}/${{ vars.REPO_NAME }}/.github/workflows/ci-pytest.yaml@feature/gha
12 changes: 6 additions & 6 deletions .github/workflows/sonarcloud/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ name: SonarCloud analysis

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
workflow_dispatch:

permissions:
Expand All @@ -49,15 +49,15 @@ jobs:
# uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
with:
# Additional arguments for the sonarcloud scanner
args:
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
# mandatory
-Dsonar.projectKey=
-Dsonar.organization=
-Dsonar.projectKey=${{ var.SONAR_PROJECT_KEY }}
-Dsonar.organization=${{ var.SONAR_ORG }}
# Comma-separated paths to directories containing main source files.
#-Dsonar.sources= # optional, default is project base directory
# When you need the analysis to take place in a directory other than the one from which it was launched
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ Repository to store my github actions manifests.
## Recommended

- [Awesome-actions](https://github.com/sdras/awesome-actions)

[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=zMynxx_github-actions)

0 comments on commit c3d9f12

Please sign in to comment.