Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/check-execute-workflow-dist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check and Update dist in js actions

on:
push:
branches:
- main
paths:
- 'execute-workflow/**'

permissions:
contents: write
Comment on lines +10 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed tbh, since you'll be using the service acc token anyways


jobs:
check-and-update-dist:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: execute-workflow/package-lock.json

- name: Install dependencies
working-directory: execute-workflow
run: npm ci

- name: Rebuild dist
working-directory: execute-workflow
run: npm run build

- name: Commit and push if changed
uses: EndBug/add-and-commit@v9
with:
author_name: Apify Release Bot
author_email: [email protected]
message: "chore: rebuild execute-workflow dist [skip ci]"
add: 'execute-workflow/dist/'
2 changes: 2 additions & 0 deletions execute-workflow/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.env
5 changes: 5 additions & 0 deletions execute-workflow/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 120
}
30 changes: 30 additions & 0 deletions execute-workflow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Execute Workflow Action

A GitHub Action for triggering workflows via `workflow_dispatch`, waiting for them to complete, and reporting their results.

- Triggers workflows using the `workflow_dispatch` event
- Waits for the workflow run to start (up to 60 seconds)
- Polls the workflow run status until completion
- Outputs the workflow run ID and conclusion
- Fails the action if the triggered workflow doesn't succeed

## Usage

```yaml
- name: Execute workflow
uses: ./execute-workflow
with:
workflow: my-workflow.yaml
inputs: '{ "key": "value" }'
```

## Inputs

- `workflow` (required): Workflow filename relative to `.github/workflows` (e.g., `my-workflow.yaml`)
- `inputs` (optional): Inputs to pass to the workflow as a JSON string
- `token` (optional): GitHub token for authentication (defaults to `${{ github.token }}`)

## Outputs

- `workflowRunId`: The ID of the triggered workflow run
- `conclusion`: The conclusion of the workflow run (`success`, `failure`, `cancelled`, etc.)
18 changes: 18 additions & 0 deletions execute-workflow/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Execute Workflow'
description: 'Execute GitHub Actions workflows and wait for them to complete'

inputs:
workflow:
description: "Workflow filename relative to .github/workflows (e.g., 'my-workflow.yaml')"
required: true
inputs:
description: 'Inputs to pass to the workflow, must be a JSON string'
required: false
token:
description: 'GitHub token for authentication'
required: false
default: ${{ github.token }}

runs:
using: 'node24'
main: 'dist/index.js'
3 changes: 3 additions & 0 deletions execute-workflow/dist/index.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions execute-workflow/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// @ts-check

import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'

export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, ...tseslint.configs.strict)
Loading