This is an example of an Apify actor for exposing the Actor's and Run's secrets stored on Apify platform.
-
-
Save JJetmar/64de272426a71e3180c99be9ec93ba58 to your computer and use it in GitHub Desktop.
Example of an Apify actor stored in a GitHub Gist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Here you choose the base Docker image for the actor. Apify provides the following images: | |
| # apify/actor-node-basic | |
| # apify/actor-node-chrome | |
| # apify/actor-node-puppeteer | |
| # However, you can use any other image from Docker Hub. | |
| # For more information, see https://apify.com/docs/actor#base-images | |
| FROM apify/actor-node:20 | |
| # Copy all files and directories from the directory to the Docker image | |
| COPY . ./ | |
| # Install NPM packages, skip optional and development dependencies to keep the image small, | |
| # avoid logging to much and show log the dependency tree | |
| RUN npm install --quiet --only=prod --no-optional \ | |
| && npm list | |
| # Define that start command | |
| ENTRYPOINT [ "node", "secrets-exposer-actor" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "secrets-exposer-actor", | |
| "version": "0.0.1", | |
| "private": true, | |
| "dependencies": { | |
| "apify": "^0.11.8" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Apify = require('apify'); | |
| Apify.main(async () => { | |
| // Expose Actor's Enviroment variables | |
| await Apify.setValue('ENV_VAR', process.env); | |
| await Apify.setValue('INPUT_EXPOSED', await Apify.getValue('INPUT')); | |
| console.log(`Check KV-store!`); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment