Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
How to access yaml variables in javascript

How to access yml variables in javascript ?

I am trying to make a static webpage and I want that only the person with the password that I will give will be able to enter but the thing I also want to hide is so not anyone seeing my repo will be able to see it.

In the main.yml :

- name: run custom code
        run: console.log($message)
        env:
          message: "starting message"
          KEY: ${{ secrets.KEY }}
  

and I want to access it here in the index.js to check if user-input is similar to the password I set in the secrets:


$(document).ready(function(){
        var key = $KEY;//here
        
        $("#submit-btn").click(function(){
            alert("button clicked");
        var nameInput = $("#name").val();
        var keyInput = $("#password").val();
        if (nameInput == "Arihant" && keyInput == key) {
            alert("welcome");
            window.location.replace("./machine.html")

        }else{
            alert("Wrong User");
            
        }
});
});

pls, tell me how I can do it?
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This article might be help you out: Reading and Writing YAML to a File in Node.js/JavaScript

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!