From 6b14ef85330da99ace0d0a641850c638ca79ad63 Mon Sep 17 00:00:00 2001 From: Yu Daike Date: Fri, 14 Feb 2025 06:54:56 +0100 Subject: [PATCH] feat: add workflow description to allow importing to other repo --- .github/workflows/run_check_source.yml | 42 ++++++++++++++++++++++++++ vcs/action.py | 1 + 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/run_check_source.yml diff --git a/.github/workflows/run_check_source.yml b/.github/workflows/run_check_source.yml new file mode 100644 index 00000000..7d33fbe6 --- /dev/null +++ b/.github/workflows/run_check_source.yml @@ -0,0 +1,42 @@ +name: Run Check Source Action + +on: + workflow_call: + +jobs: + review: + runs-on: ubuntu-latest + steps: + - name: Checkout release tools + uses: actions/checkout@v4 + with: + repository: YoukouTenhouin/openSUSE-release-tools + ref: vcs-refactor + path: release_tools + + - name: Set up Python + uses: actions/setup-python@v4 + with: + repository: ${{ github.repository }} + ref: ${{ github.sha }} + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r release_tools/requirements.txt + + - name: Run check_source + id: check_source + run: | + # set OBS API address to http://localhost:3000 just in case + python check_source.py --scm-type=Action --platform=Action --debug -A http://localhost:3000 + working-directory: release_tools + + - name: Check results + if: steps.check_source.outcome != 'success' + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + core.setFailed('check_source rejected review. Check the logs for details.') diff --git a/vcs/action.py b/vcs/action.py index f9834a8c..da5f664e 100644 --- a/vcs/action.py +++ b/vcs/action.py @@ -35,4 +35,5 @@ class Action(vcs.base.VCSBase): src = os.environ["GITHUB_WORKSPACE"] dst = f'{pathname}/{target_package}' self.logger.debug(f'checkout: {src} -> {dst}') + self.logger.debug('Contenxt: ', self.context) shutil.copytree(src, dst)