Giter Site home page Giter Site logo

actionsflow / actionsflow Goto Github PK

View Code? Open in Web Editor NEW
3.1K 3.1K 125.0 3.83 MB

The free Zapier/IFTTT alternative for developers to automate your workflows based on Github actions

Home Page: https://actionsflow.github.io/docs

License: MIT License

JavaScript 8.20% TypeScript 89.81% Handlebars 1.71% Dockerfile 0.12% Makefile 0.17%
actions actionsflow automate hacktoberfest ifttt workflow zapier

actionsflow's Introduction

Project logo

Actionsflow

Actionsflow npm version npm Docker Pulls Build codecov GitHub Issues GitHub Pull Requests GitHub stars License


The free IFTTT/Zapier alternative for developers to automate their workflows based on GitHub actions, option to run self-hosted without GitHub as well


๐Ÿ“ Table of Contents

๐Ÿ˜ About

Actionsflow helps you automate workflows - it's a free IFTTT/Zapier alternative for developers. With Actionsflow you can connect your favorite apps, data, and APIs, receive notifications of actions as they occur, sync files, collect data, and more. We implemented it based on Github actions, and you use a YAML file to build your workflows. The configuration format is the same as Github actions, which makes it easy for you to get going if you've explored Github actions before. You can also use any Github actions as your job's steps.

You can learn more about the core concepts of Actionsflow here.

If you want a lighter, simpler workflow that doesn't rely on Github Actions, consider Denoflow, another workflow tool made by me, based on Deno with YAML , you can try it at an online playground

๐Ÿ”ฅ Features

๐ŸŽ“ Documentation

Full documentation for Actionsflow lives on the website.

You can also view it on Github if you prefer.

๐Ÿ‘€ How Actionsflow works

Actionsflow uses Github Actions' repository_dispatch event and scheduled event every 5 minutes to run Actionsflow triggers. Those triggers generate result items, which are cached and deduplicated, generating a standard Github actions workflow file with the trigger result. Finally, the workflows are executed using act (a tool for running GitHub Actions locally).

To learn more about how Actionsflow works, please see Core Concepts of Actionsflow.

๐Ÿ Getting Started

For self-hosted version please see here

  1. Create a public Github repository by using this link.

    A typical Actionsflow repository structure looks like this:

    โ”œโ”€โ”€ .github
    โ”‚   โ””โ”€โ”€ workflows
    โ”‚       โ””โ”€โ”€ actionsflow.yml
    โ”œโ”€โ”€ .gitignore
    โ”œโ”€โ”€ README.md
    โ””โ”€โ”€ workflows
    โ”‚   โ””โ”€โ”€ rss.yml
    โ”‚   โ””โ”€โ”€ webhook.yml
    โ””โ”€โ”€ package.json
  2. Uncomment .github/workflows/actionsflow.yml schedule event

    on:
      schedule:
        - cron: "*/15 * * * *"

    Note: To prevent abuse, by default, the schedule is commented, please modify the schedule time according to your own needs, the default is once every 15 minutes. Learn more about schedule event, please see here

  3. Create your workflow files inside the workflows directory

    A typical workflow file rss.yml looks like this:

    on:
      rss:
        url: https://hnrss.org/newest?points=300&count=3
    jobs:
      request:
        name: Make a HTTP Request
        runs-on: ubuntu-latest
        steps:
          - name: Make a HTTP Request
            uses: actionsflow/axios@v1
            with:
              url: https://hookb.in/VGPzxoWbdjtE22bwznzE
              method: POST
              body: |
                {
                  "link":"${{ on.rss.outputs.link }}", 
                  "title": "${{ on.rss.outputs.title }}",
                  "content":"<<<${{ on.rss.outputs.contentSnippet }}>>>"
                }

    For more information about the Actionsflow workflow file, see the Actionsflow workflow reference.

    You can find examples and inspiration on the Trigger List and on Awesome Actionsflow Workflows.

  4. Commit and push your updates to Github

Pushing to Github makes Actionsflow run the workflows you defined. You can view logs at your repository's actions tab on Github.

For more information about getting up and running, see Getting Started.

๐ŸŽ“ Learn More

Full documentation for Actionsflow lives on the website.

๐Ÿ‘ How to Contribute

Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the Actionsflow community! ๐Ÿ’ช๐Ÿ’œ

Check out our Contributing Guide for ideas on contributing and setup steps for getting our repositories up and running on your local machine.

โœ‹ Authors

See also the list of contributors who participated in this project.

๐Ÿ“ License

Licensed under the MIT License.

actionsflow's People

Contributors

a4b8 avatar floer32 avatar johnrees avatar lucasew avatar markiannucci avatar pgaspar avatar theowenyoung avatar yyolk avatar zhgqthomas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actionsflow's Issues

Run fails with an error, but I don't know where the error happened

Description

All triggers completed correctly (all rss, all saying INFO actionsflow: No new updates found at trigger [rss] of workflow [something.yml], skip it.). The log says there are some errors, right after the cache is uploaded, but not where the errors happened.

Steps to reproduce

Just happened to me; not sure what's going on exactly. This is the log:

Try to restore actionsflow cache [actionsflow-cache-key-linux-2116f5daa5cb9a6d17f4c1ffa85f2a87d7148e95] to .cache
Received 5275 of 5275 (100.0%), 0.1 MBs/sec
Cache Size: ~0 MB (5275 B)
/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/b51f7e29-5b7e-4206-9c54-59e99d227a0e/cache.tzst -P -C /home/runner/work/if-this-then-that/if-this-then-that
Restore actionsflow cache complete (284 ms)
Use action actionsflow-action to build
Actionsflow CLI version: 1.1.4

[14:02:45] INFO actionsflow: Clean the dest folder
[14:02:46] INFO actionsflow: No new updates found at trigger [rss] of workflow [one.yml], skip it.
[14:02:46] INFO actionsflow: No new updates found at trigger [rss] of workflow [two.yml], skip it.
[14:02:47] INFO actionsflow: No new updates found at trigger [rss] of workflow [three.yml], skip it.
[14:02:48] INFO actionsflow: No new updates found at trigger [rss] of workflow [four.yml], skip it.
[14:02:49] INFO actionsflow: No new updates found at trigger [rss] of workflow [five.yml], skip it.
[14:02:50] INFO actionsflow: No new updates found at trigger [rss] of workflow [six.yml], skip it.
[14:02:50] INFO actionsflow: No new updates found at trigger [rss] of workflow [seven.yml], skip it.
[14:02:51] INFO actionsflow: No new updates found at trigger [rss] of workflow [eight.yml], skip it.
[14:02:51] INFO actionsflow: No new updates found at trigger [rss] of workflow [nine.yml], skip it.
[14:02:51] INFO actionsflow: Done.
Run actionsflow complete (6.29 s)
Actionsflow cache [actionsflow-cache-key-linux-2116f5daa5cb9a6d17f4c1ffa85f2a87d7148e95] is already exists, do not need to upload
Upload actionsflow cache complete (13 ms)
Total size of all the files uploaded is 68 bytes
Finished uploading artifact ACTIONSFLOW_CACHE_KEY____actionsflow-cache-key-linux-2116f5daa5cb9a6d17f4c1ffa85f2a87d7148e95. Reported size is 68 bytes. There were 0 items that failed to upload
There are some errors occurred, but we will continue the process, we'll throw error at post action
Error: read ECONNRESET
Actionsflow done in 7.29 s

Expected result

I should either see what the error was, or the action should complete. I have no clue where the ECONNRESET happened.

Actual result

See above.

Create a Video Tutorial

A video tutorial would be really helpful

Video tutorial of

  1. Using an existing trigger
  2. Creating your own trigger

Would be extremely helpful.

Need a community

Need a community. Such as Telegram group.
้œ€่ฆไธ€ไธช็คพๅŒบ๏ผŒTG ็พคไนŸๅฏไปฅ :D

Cached when failed.

Description

The rss item is cached when the jobs failed.

Steps to reproduce

Use rss trigger. Jobs failed. Cached

Expected result

If failed. Don't cache

Can't separate key from value

Description

The Actions always failed if I use Github secrets in my workflow.

Steps to reproduce

image

Expected result

Actions run success

Actual result

Actions run failed.
image

Change the Port

Context
I have other programs running on port 3000.

Alternatives
Run everything inside a docker container, so that the port can easily be mapped.

Has the feature been requested before?
No.

If the feature request is approved, would you be willing to submit a PR?
Yes

Timeout error messages aren't really clear

Description

When a trigger times out, the error message looks like this:

Actionsflow CLI version: 1.1.3

[14:54:45] INFO actionsflow: Clean the dest folder
[14:54:45] INFO actionsflow: No new updates found at trigger [rss] of workflow [01.yml], skip it.
[14:54:46] INFO actionsflow: No new updates found at trigger [rss] of workflow [02.yml], skip it.
[14:55:46] ERROR Actionsflow-trigger [rss]: fetch rss feed [https://someblog.com/feed/] error:  Error: Request timed out after 60000ms
    at Timeout.<anonymous> (/home/runner/work/_actions/actionsflow/actionsflow-action/v1/dist/main/index.js:1:661691)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
[14:55:47] INFO actionsflow: No new updates found at trigger [rss] of workflow [04.yml], skip it.
[14:55:48] INFO actionsflow: No new updates found at trigger [rss] of workflow [05.yml], skip it.
[14:55:48] INFO actionsflow: No new updates found at trigger [rss] of workflow [06.yml], skip it.
[14:55:48] INFO actionsflow: No new updates found at trigger [rss] of workflow [07.yml], skip it.
[14:55:48] INFO actionsflow: No new updates found at trigger [rss] of workflow [08.yml], skip it.
[14:55:49] INFO actionsflow: No new updates found at trigger [rss] of workflow [09.yml], skip it.
[14:55:49] INFO actionsflow: When running trigger [rss], an error occured Error: Request timed out after 60000ms
    at Timeout.<anonymous> (/home/runner/work/_actions/actionsflow/actionsflow-action/v1/dist/main/index.js:1:661691)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
[14:55:49] INFO actionsflow: Done.

But it's not clear from the log that the last error entry represents the same issue as the first error entry, nor either error entry mentions the flow file it was running when it caused the issue. Not sure if it's an issue limited to the rss trigger.

Steps to reproduce

In my case, the issue is an RSS feed trigger that times out for whatever reason (the feed is there, when checking from my computer).

Expected result

The first error message should say the name of the flow file it was running, and the last error message, which I assume is a recap of the errors that happened, should make it clear it's about recapping the errors that occurred during the run.

Actual result

See log above.

reference more awesome github actions list

Context

What are you trying to do and how would you want to do it differently? Is it something you currently you cannot do? Is this related to an issue/problem?

In doc there are plenty actionsflow official triggers and actions, but it does not reveal the full strength of the actionsflow (can reuse any github action in steps)

suggest to list some of notification actions like https://github.com/sdras/awesome-actions#notifications-and-messages in actionsflow's doc

to out reach more users, might also worth to list actionsflow's official triggers/actions to

https://github.com/sdras/awesome-actions

Alternatives

Can you achieve the same result doing it in an alternative way? Is the alternative considerable?

search and self learn the github actions

Has the feature been requested before?

NA

If the feature request is approved, would you be willing to submit a PR?

No

NPM dependencies for local triggers are not installed

Description

When using local triggers, the trigger's dependencies (defined in triggers/<trigger-name>/package.json) aren't installed when running Actionsflow as an action.

As a result the "Run Actionsflow" step fails with

Error: Error: Cannot find module '<dependency-name>'
Require stack:
- /home/runner/work/actionsflow-automation/actionsflow-automation/triggers/<trigger-name>/index.js
- /home/runner/work/_actions/actionsflow/actionsflow-action/v1.3.0/dist/main/index.js

Steps to reproduce

See my demo repo.

Alternatively, create a local trigger yourself:

  1. Create a triggers/foobar/ directory
  2. Navigate into it and run npm init && npm install cheerio
  3. Create an index.js file containing const { load } = require("cheerio");
  4. Add the foobar trigger to one of your workflows
  5. Run Actionsflow using the default GitHub Action

Expected result

The trigger dependencies should be installed, and the trigger should execute.

Actual result

The trigger dependencies were not installed, so the trigger failed with Error: Cannot find module '<dependency-name>'

Heroku

How to deploy this app on Heroku?

Should formatting run before `getItemKey`?

Description

I'm trying to use the api poll trigger to query a json list of upvoted posts (available from https://www.reddit.com/prefs/feeds/).
But the json is quite complicated, so I used the itemsPath and format options to simplify things, but I think the deduplicationKey uses the unprocessed json, which constantly changes and has the id property as a nested item.

If the json formatting was run before the deduplication the poll trigger could be used for much more complicated json.

Example doesn't start chromium with puppeteer in docker

Description

Chromium isn't starting in the docker container.

Steps to reproduce

Add https://github.com/actionsflow/actionsflow/blob/main/examples/actionsflow-workflow-example/workflows/reddit-combine.yml to workflows and run.

Expected result

Outpout as in the example.

Actual result

/usr/local/lib/node_modules/actionsflow/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/usr/local/lib/node_modules/actionsflow/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:203:20)
at Interface.<anonymous> (/usr/local/lib/node_modules/actionsflow/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:68)
at Interface.emit (events.js:388:22)
at Interface.close (readline.js:429:8)
at Socket.onend (readline.js:202:10)
at Socket.emit (events.js:388:22)
at endReadableNT (internal/streams/readable.js:1336:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)

UNHANDLED REJECTION TriggersError: Multiple Errors when running triggers
at build (/usr/local/lib/node_modules/actionsflow/dist/src/build.js:242:15)
at async runWorkflows (/usr/local/lib/node_modules/actionsflow/dist/src/run-workflows.js:18:5)
at async /usr/local/lib/node_modules/actionsflow/dist/src/cron.js:13:13 {
errors: [
{
error: Error: Failed to launch the browser process!
/usr/local/lib/node_modules/actionsflow/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

  TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

      at onClose (/usr/local/lib/node_modules/actionsflow/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:203:20)
      at Interface.<anonymous> (/usr/local/lib/node_modules/actionsflow/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:68)
      at Interface.emit (events.js:388:22)
      at Interface.close (readline.js:429:8)
      at Socket.onend (readline.js:202:10)
      at Socket.emit (events.js:388:22)
      at endReadableNT (internal/streams/readable.js:1336:12)
      at processTicksAndRejections (internal/process/task_queues.js:82:21),
  trigger: [Object],
  workflow: [Object]
}

]
}

Reset cache does not work

Description

When I'm running the GitHub action to reset the cache and then trigger the Actionsflow GitHub action it does not execute my workflows.

Steps to reproduce

  1. Have your workflows run (so that a cache exists)
  2. Manually trigger the Reset Actionsflow Cache GitHub action via the webinterface
  3. Manually trigger the Actionsflow GitHub action via the webinterface

You can use my current workflows repository here. An example cache reset is here and the corresponding Actionsflow run afterwards is here.

Expected result

After resetting the cache it should run all my workflows, in this case it's about cached RSS feeds.

Actual result

It does not run the workflows meaning he already "knows" the RSS feeds because the cache probably still exists.

Run act step in GitHub action gives an error

Description

After running a GitHub action using the Instagram trigger, I've faced the following error in the Run act GitHub action step.

[0-instagram-instagram.yml/Print 0] ๐Ÿš€  Start image=actionsflow/act-environment:v1
[0-instagram-instagram.yml/Print 0]   ๐Ÿณ  docker pull image=actionsflow/act-environment:v1 platform= username= forcePull=false
[0-instagram-instagram.yml/Print 0]   ๐Ÿณ  docker create image=actionsflow/act-environment:v1 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[0-instagram-instagram.yml/Print 0]   ๐Ÿณ  docker run image=actionsflow/act-environment:v1 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[0-instagram-instagram.yml/Print 0]   ๐Ÿณ  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
time="2022-02-14T20:31:59Z" level=fatal msg="yaml: unmarshal errors:\n  line 11: cannot unmarshal !!map into string"

Steps to reproduce

Create a instagram.yml file with the following content:

on:
  instagram:
    access_token: ${{ secrets.INSTAGRAM_ACCESS_TOKEN }}
    user_id: ${{ secrets.INSTAGRAM_USER_ID }}
    fetchAllResultsAtFirst: true
    maxCount: 1000

jobs:
  print:
    name: Print
    runs-on: ubuntu-latest
    steps:
      - name: Print Outputs
        env:
          outputs: { { toJSON(on.instagram.outputs) } }
        run: echo $outputs

Make an Instagram post so that the triggered workflow gets ran.

See the action failing.

Expected result

The GitHub action should not have any issues and should return what the action file says.

Actual result

The GitHub action fails and exits with status code 1.

step id can not end with "on"

Description

Step name can not end with "on", like "translation", it will parse it to translatiundefined

on:
  workflow_dispatch:
jobs:
  translation:
    name: Print
    runs-on: ubuntu-latest
    steps:
      - name: Translate to ZH
        id: translation
        uses: fabasoad/translation-action@main
        with:
          source: test
      - name: Print translation result
         run: echo "${{ steps.translation.outputs.text }}"

on is a keyword of Actionsflow, it should check the regex rule.

Webhook triggered on every scheduled run on a self-hosted instance

Description

First things first, I just wanted to say this is an amazing project. The amount of work put into it is immeasurable and so is its potential. Personally, I noticed it as a potential foundation of a self-hosted alternative to Github Actions.

While working on it, I have stumbled upon a type of behavior I don't understand. Initially, I wanted to file a feature request to tailor actionsflow to my needs. However, as I had continued my research, I was becoming more and more convinced that it might actually be a bug that I'm dealing with.

Here's what I've achieved so far.

Steps to reproduce

Firstly, I created the repository from the actionsflow template and defined a simple hello world workflow triggered by a webhook:

workflows/test-repo.yml
on:
  webhook:
jobs:
  print:
    name: Print
    runs-on: ubuntu-latest
    steps:
      - name: Print outputs
        env:
          method: ${{on.webhook.outputs.method}}
          body: ${{toJson(on.webhook.outputs.body)}}
          headers: ${{toJson(on.webhook.outputs.headers)}}
        run: |
          echo method: $method
          echo headers $headers
          echo body: $body

Then I ran actionsflow in a docker container with the repository mounted as /data volume.

After that I created an empty git repository on my local machine and set up a remote for it on the server. Leveraging built-in git hooks functionality, I created a mechanism calling test-repo webhook each time the remote is updated.

Here's the script I came up with, utilizing curl to call the webhook endpoint. Input data is accepted in accordance to relevant git docs page.

/hooks/post-receive
#!/bin/bash

WEBHOOK_URL="https://example.com/webhook/test-repo/webhook/"
read oldref newref refname

curl -v \
        -X POST \
        -H "Content-Type: application/json" \
        -d "{\"oldref\": \"${oldref}\", \"newref\": \"${newref}\", \"refname\": \"${refname}\"}" \
        $WEBHOOK_URL

Expected result

As the result, whenever I push new commit to the remote, the post-receive hook is triggered, which in turn triggers the webhook.

Here are the logs from the *actionsflow* container:
[18:41:26] INFO actionsflow: Clean the dest folder dist/.cron/1644864086329
[18:41:26] INFO actionsflow: There are 1 immediate tasks, 0 delay tasks
[18:41:26] INFO actionsflow: Run 1 immediate tasks finished, wait for 0 delay tasks to finish...
[18:41:26] INFO actionsflow: All tasks finished, wait for building...
[18:41:26] INFO actionsflow: 1 updates found at trigger [webhook] of workflow [test-repo.yml], workflow file 0-test-repo-webhook.yml build success
[18:41:26] INFO actionsflow: Done.
[18:41:35] INFO actionsflow: Clean the dest folder dist/.cron/1644864095453
[18:41:35] INFO actionsflow: There are 1 immediate tasks, 0 delay tasks
[18:41:35] INFO actionsflow: Run 1 immediate tasks finished, wait for 0 delay tasks to finish...
[18:41:35] INFO actionsflow: All tasks finished, wait for building...
[18:41:35] INFO actionsflow: 1 updates found at trigger [webhook] of workflow [test-repo.yml], workflow file 0-test-repo-webhook.yml build success
[18:41:35] INFO actionsflow: Done.
[0-test-repo-webhook.yml/Print 0] ๐Ÿš€  Start image=actionsflow/act-environment:v1
[0-test-repo-webhook.yml/Print 0]   ๐Ÿณ  docker run image=actionsflow/act-environment:v1 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[0-test-repo-webhook.yml/Print 0]   ๐Ÿณ  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[0-test-repo-webhook.yml/Print 0] โญ  Run Print outputs
[0-test-repo-webhook.yml/Print 0]   ๐Ÿณ  docker exec cmd=[bash --noprofile --norc -e -o pipefail /data/workflow/0] user=
| method: post
| headers { "accept": "*/*", "content-length": "60", "content-type": "application/json", "host": "example.com", "user-agent": "curl/7.64.0", "x-forwarded-for": "172.19.0.1", "x-forwarded-host": "example.com", "x-forwarded-proto": "https", "x-forwarded-ssl": "on", "x-real-ip": "172.19.0.1" }
| body: { "newref": "b", "oldref": "a", "refname": "refs/heads/main" }
[0-test-repo-webhook.yml/Print 0]   โœ…  Success - Print outputs

Actual result

Up to this point, everything operates well and servers the established purpose perfectly. However, for a reason unbeknownst to me, the webhook event is thrown into some eternal queue it never leaves. Every 5 minutes aciontsflow finds a new update at trigger webhook of workflow test-repo.yml and decides to run the workflow.

Some more logs
[20:30:00] INFO actionsflow: Clean the dest folder dist/.cron/1644870600046
[20:30:00] INFO actionsflow: There are 1 immediate tasks, 0 delay tasks
[20:30:00] INFO actionsflow: Run 1 immediate tasks finished, wait for 0 delay tasks to finish...
[20:30:00] INFO actionsflow: All tasks finished, wait for building...
[20:30:00] INFO actionsflow: 1 updates found at trigger [webhook] of workflow [test-repo.yml], workflow file 0-test-repo-webhook.yml build success
[20:30:00] INFO actionsflow: Done.
[0-test-repo-webhook.yml/Print 0] ๐Ÿš€  Start image=actionsflow/act-environment:v1
[0-test-repo-webhook.yml/Print 0]   ๐Ÿณ  docker run image=actionsflow/act-environment:v1 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[0-test-repo-webhook.yml/Print 0]   ๐Ÿณ  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[0-test-repo-webhook.yml/Print 0] โญ  Run Print outputs
[0-test-repo-webhook.yml/Print 0]   ๐Ÿณ  docker exec cmd=[bash --noprofile --norc -e -o pipefail /data/workflow/0] user=
| method: post
| headers { "accept": "*/*", "content-length": "60", "content-type": "application/json", "host": "example.com",  "user-agent": "curl/7.64.0", "x-forwarded-for": "172.19.0.1", "x-forwarded-host": "example.com", "x-forwarded-proto": "https", "x-forwarded-ssl": "on", "x-real-ip": "172.19.0.1" }
| body: { "newref": "b", "oldref": "a", "refname": "refs/heads/main" }
[0-test-repo-webhook.yml/Print 0]   โœ…  Success - Print outputs

I suspect the initiator of these calls to be a scheduled run. Correct me if I'm wrong, but documentation doesn't really explain what's the backbone of scheduled runs on a self-hosted instance. Had I used actionsflow with Github Actions, I'd go straight to .github/workflows/actionsflow.yml and adjust the cron. Can I do a similar thing on a self-hosted instance?

That being a case, why does webhook trigger detects and update on every scheduled run? I expected it to kick-off the workflow once, when it's called and remain silent until next qualified call arrives.

In attempt to alter this behavior, I tried adding on.webhook.config.skipSchedule=true, but that didn't change anything. Workflow would still get started every 5 minutes and I think it accounts for major inconsistency between documentation and actual behavior that might be potentially recognized as a bug, as the documentation states that (...)trigger should skip schedule event.(...) Use this param when you want a trigger to run only manually when this flag is used.

As the last thing, I'd like to take a note of my relatively low level of experience with actionsflow. There might have been a misunderstanding of some of its concepts. If you don't perceive the behavior I've explained as a bug, I'd be very glad to hear your opinions on my way and intends of using actionsflow.

Webhook Worker May Log GH Personal Access Key

Description

If I'm not mistaken Personal Access Keys to Github Actions may be logged to Sentry and/or Cloudflare (if it is being tailed somewhere).

Steps to reproduce

Setup a Slack or other Webhooks integration to https://webhook.actionsflow.workers.dev (https://github.com/actionsflow/webhook2github)

Expected result

Personal Access Key is kept private or at baseline an explanation in the documentation that this will be logged and an alternative path.

Actual result

Reading the source code, it seems likely the potentially sensitive GitHub key will be logged into Actionsflow's Sentry.

Maybe setup of the Cloudflare worker could be part of the self-hosted Actionsflow documentation and then this could be mentioned?

When using multi rss feed trigger, only the first rss feed triggers the action

Description

When using multi rss feed trigger, only the first rss feed triggers the action

Steps to reproduce

on:
  rss:
    url:
      - https://www.apartmenttherapy.com/main.rss
      - https://stylebyemilyhenderson.com/feed
      - https://feeds.feedburner.com/younghouselove
      - https://cococozy.com/feed/
    config:
      limit: 30
      every: "*/5 * * * *" # every 5 mins

^ here is my rss.yml file

Expected result

I expect this should trigger not just for the first rss feed, but also all the rss feed listed

Actual result

Only the first url in the list triggers my action

Multiple rss feeds as trigger returns error

Description

When I'm using three urls for my RSS trigger it works fine. When I add another one it will fail and throw an error OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: argument list too long: unknown. This also happens when I use multiple RSS triggers in different workflows as long as they have all together four urls.

This commit adds two urls so that the workflow has four urls together. This workflow run was before the commit and everything was fine. This workflow run was after the commit and throw the error.

Steps to reproduce

  1. Create a workflow with a RSS trigger with at least four urls
  2. Trigger the workflow

Expected result

All four urls should be crawled and the workflow should be executed.

Actual result

The workflow throws an error and fails.

Node version of runner on self-hosted Docker install

Description

I am setting up a workflow to run via self-hosted Docker install. I have created a workflow and am able to execute it successfully but am getting an error saying a GitHub Action step needs to use node12 but the action is setup to use node16.

Is the github actions runner code out-of-date? I know github actions supports node16? What package needs to be updated in order to support node16 actions in self-hosted install?

Steps to reproduce

Note: See workflow source code files pasted below. First, I'll describe the steps.

  • Save actionsflow workflow file and javascript script trigger file.
  • Run the actionsflow workflow via Docker. I am using macOS. I have the latest actionsflow docker image as I deleted all of my images on my machine before running.
  • When executing actionsflow workflow, it should execute the workflow right away because of the javascript script trigger returning 1 object.

When you execute the script, you will find the error I am describing:

time="2022-08-22T19:54:54Z" level=info msg="  โ˜  git clone 'https://github.com/actions/github-script' # ref=v6"
actionsflow_1  | [0-email-to-ynab-script.yml/Email to YNAB 0]   โŒ  Failure - Get data from trigger
actionsflow_1  | Error: The runs.using key in action.yml must be one of: [composite docker node12], got node16

The error message makes me think that we are using an old version of act as the github actions runner in act is probably too old and does not support node16? But I am executing actionsflow/setup-act-for-actionsflow@v1 in my workflow to install the latest version 0.2.25 and still get the error.

Here is my full actionsflow workflow:

# on:
#   email:
#     imap:
#       host: imap.fastmail.com
#       port: 993
#       user: ${{secrets.EMAIL_USER}}
#       password: ${{secrets.EMAIL_PASSWORD}}
on: 
  script:
    path: ./workflows/test-data/email-to-ynab.js        

jobs:
  email-to-ynab:
    name: Email to YNAB
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3 # checkout to get the local actions I created 
      - uses: actionsflow/setup-act-for-actionsflow@v1 # to install latest act version
      
      # This is the action where the error occurs. However, if I try to use *any* action 
      # that is setup to run using node16, the same error will occur. This action is easy to test with. 
      - name: Get data from trigger 
        uses: actions/github-script@v6
        id: data
        env:
          TRIGGER_EMAIL_DATA: ${{ on.email }}
          TRIGGER_TEST_DATA: ${{ on.script }}
        with:
          # Script has not been tested yet. It might not work. Error occurs before script can even execute. 
          script: |
            const triggerData = process.env.TRIGGER_EMAIL_DATA || process.env.TRIGGER_TEST_DATA
            core.setOutput('data', triggerData.outputs)

The script trigger file ./workflows/test-data/email-to-ynab.js is:

// Note: I left some 
const emailNoTransaction = {
  "attachments": [
    {
      "mimeType": "text/plain",
      "data": "dGVzdA==",
      "fileName": "test.txt",
      "fileExtension": "txt"
    }
  ],
  "text": "Test body.",
  "textAsHtml": "<p>Test body.</p>",
  "subject": "Test Subject",
  "date": "2020-09-14T23:44:20.000Z",
  "to": {
    "value": [
      {
        "address": "[email protected]",
        "name": ""
      }
    ],
    "html": "<span class=\"mp_address_group\"><a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a></span>",
    "text": "[email protected]"
  },
  "from": {
    "value": [
      {
        "address": "[email protected]",
        "name": "Owen Young"
      }
    ],
    "html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Owen Young</span> &lt;<a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a>&gt;</span>",
    "text": "Owen Young <[email protected]>"
  },
  "cc": {
    "value": [
      {
        "address": "[email protected]",
        "name": ""
      },
      {
        "address": "[email protected]",
        "name": ""
      }
    ],
    "html": "<span class=\"mp_address_group\"><a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a></span>, <span class=\"mp_address_group\"><a href=\"mailto:[email protected]\" class=\"mp_address_email\">[email protected]</a></span>",
    "text": "[email protected], [email protected]"
  },
  "messageId": "<[email protected]>",
  "html": false
}

module.exports = async function ({ helpers }) {
    return [
        emailNoTransaction
    ]
};

Expected result

My workflow can execute github actions that run using node16.

Actual result

My workflow only supports running github actions that run on node12 at the highest.

in_progress count check is zero breaks the actionflow

Description

Used to have this step from the default template setup, and in_progress suddenly reports 0 a few days ago (without any code changes), and the filename actionsflow.yml stays the same. This breaks the following steps' if conditions.

    steps:
      - name: Check is running
        uses: actions/github-script@v4
        id: runningCount
        with:
          github-token: ${{secrets.GITHUB_TOKEN}}
          script: |
            const runed = await github.actions.listWorkflowRuns({
              owner: context.repo.owner,
              repo: context.repo.repo,
              workflow_id: "actionsflow.yml",
              status:"in_progress"
            });
            console.log(runed.data.total_count);
            return runed.data.total_count;
          result-encoding: string
Run actions/github-script@v4
  with:
    github-token: ***
    script: const runed = await github.actions.listWorkflowRuns({
    owner: context.repo.owner,
    repo: context.repo.repo,
    workflow_id: "actionsflow.yml",
    status:"in_progress"
  });
  console.log(runed.data.total_count);
  return runed.data.total_count;
  
    result-encoding: string
    debug: false
    user-agent: actions/github-script
0

Steps to reproduce

Steps mentioned above.

Possible solution

One possible solution: instead of checking the count of "in_progress", which might be unreliable due to how github defines it, a github action native feature concurrency may be helpful here:

concurrency:
  group: actionsflow
  cancel-in-progress: true

Use GitHub secrets in trigger config

Context

I'd like to not just use GitHub Secrets in my action steps but rather also in the config setup of my trigger. Currently doing so always throws an error

on:
  rss:
    url:
      - "${{ RSS_FEED }}"

Trying this fails. I don't know how to prevent leaking the secret as e.g. when an URL is not available (because the web server is down or whatever) it sometimes prints the url to the console

Alternatives

I don't know of any way

Has the feature been requested before?

No

If the feature request is approved, would you be willing to submit a PR?

Maybe if I have enough inputs on what to do and where

Docker Compose

Since everything today is in docker, it would be nice to see this project as well.

I tried to create one,

version: "3.3"
services:
    actionsflow:
        image: actionsflow/actionsflow:latest
        restart: unless-stopped
        container_name: actionsflow
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - /docker/actionsflow:/data
        ports:
            - 3232:3000

but I get errors (errnos):

Actionsflow CLI version: 1.12.1
[16:51:57] INFO actionsflow: Start server at http://localhost:3000
[16:51:57] INFO actionsflow: Listen webhook endpoint at http://localhost:3000/webhook/
[16:51:57] INFO actionsflow: Start cron tasks
[16:51:57] INFO actionsflow: Clean the dest folder dist/.cron/1679417517172
UNHANDLED REJECTION [Error: ENOENT: no such file or directory, lstat '/data/workflows'] {
๏ฟฝ
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/data/workflows'
}
[16:55:00] INFO actionsflow: Clean the dest folder dist/.cron/1679417700101
UNHANDLED REJECTION [Error: ENOENT: no such file or directory, lstat '/data/workflows'] {
๏ฟฝ
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/data/workflows'
}

It looks like the actionsflow/actionsflow:latest repository is missing some files for the service to work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.