Skip to content

Commit

Permalink
ci: gitlab add dangerjs pre-check
Browse files Browse the repository at this point in the history
  • Loading branch information
leeebo committed Dec 14, 2023
1 parent 13adff8 commit 53a34c3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/dangerjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: DangerJS Pull Request linter
on:
pull_request_target:
types: [opened, edited, reopened, synchronize]

permissions:
pull-requests: write
contents: write

jobs:
pull-request-style-linter:
runs-on: ubuntu-latest
steps:
- name: Check out PR head
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: DangerJS pull request linter
uses: espressif/shared-github-dangerjs@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 1 addition & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ workflow:
variables:
IOT_SOLUTION_PATH: "$CI_PROJECT_DIR"

before_script:
# add gitlab ssh key
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git --version
- git submodule update --init --recursive

include:
- '.gitlab/ci/danger.yml'
- '.gitlab/ci/rules.yml'
- '.gitlab/ci/pre_check.yml'
- '.gitlab/ci/build.yml'
Expand Down
10 changes: 10 additions & 0 deletions .gitlab/ci/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Extenal DangerJS
include:
- project: espressif/shared-ci-dangerjs
ref: master
file: danger.yaml

run-danger-mr-linter:
stage: pre_check
tags:
- dangerjs

0 comments on commit 53a34c3

Please sign in to comment.